Package com.sun.jna.platform.win32
Klasse Crypt32Util
java.lang.Object
com.sun.jna.platform.win32.Crypt32Util
Crypt32 utility API.
- Autor:
- dblock[at]dblock.org
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic String
CertNameToStr
(int dwCertEncodingType, int dwStrType, WinCrypt.DATA_BLOB pName) Utility method to call to Crypt32's CertNameToStr that allocates the assigns the required memory for the psz parameter based on the type mapping used, calls to CertNameToStr, and returns the received string.static byte[]
cryptProtectData
(byte[] data) Protect a blob of data.static byte[]
cryptProtectData
(byte[] data, byte[] entropy, int flags, String description, WinCrypt.CRYPTPROTECT_PROMPTSTRUCT prompt) Protect a blob of data.static byte[]
cryptProtectData
(byte[] data, int flags) Protect a blob of data with optional flags.static byte[]
cryptUnprotectData
(byte[] data) Unprotect a blob of data.static byte[]
cryptUnprotectData
(byte[] data, byte[] entropy, int flags, WinCrypt.CRYPTPROTECT_PROMPTSTRUCT prompt) Unprotect a blob of data.static byte[]
cryptUnprotectData
(byte[] data, int flags) Unprotect a blob of data.
-
Konstruktordetails
-
Crypt32Util
public Crypt32Util()
-
-
Methodendetails
-
cryptProtectData
public static byte[] cryptProtectData(byte[] data) Protect a blob of data.- Parameter:
data
- Data to protect.- Gibt zurück:
- Protected data.
-
cryptProtectData
public static byte[] cryptProtectData(byte[] data, int flags) Protect a blob of data with optional flags.- Parameter:
data
- Data to protect.flags
- Optional flags, eg. CRYPTPROTECT_LOCAL_MACHINE | CRYPTPROTECT_UI_FORBIDDEN.- Gibt zurück:
- Protected data.
-
cryptProtectData
public static byte[] cryptProtectData(byte[] data, byte[] entropy, int flags, String description, WinCrypt.CRYPTPROTECT_PROMPTSTRUCT prompt) Protect a blob of data.- Parameter:
data
- Data to protect.entropy
- Optional entropy.flags
- Optional flags.description
- Optional description.prompt
- Prompt structure.- Gibt zurück:
- Protected bytes.
-
cryptUnprotectData
public static byte[] cryptUnprotectData(byte[] data) Unprotect a blob of data.- Parameter:
data
- Data to unprotect.- Gibt zurück:
- Unprotected blob of data.
-
cryptUnprotectData
public static byte[] cryptUnprotectData(byte[] data, int flags) Unprotect a blob of data.- Parameter:
data
- Data to unprotect.flags
- Optional flags, eg. CRYPTPROTECT_UI_FORBIDDEN.- Gibt zurück:
- Unprotected blob of data.
-
cryptUnprotectData
public static byte[] cryptUnprotectData(byte[] data, byte[] entropy, int flags, WinCrypt.CRYPTPROTECT_PROMPTSTRUCT prompt) Unprotect a blob of data.- Parameter:
data
- Data to unprotect.entropy
- Optional entropy.flags
- Optional flags.prompt
- Optional prompt structure.- Gibt zurück:
- Unprotected blob of data.
-
CertNameToStr
Utility method to call to Crypt32's CertNameToStr that allocates the assigns the required memory for the psz parameter based on the type mapping used, calls to CertNameToStr, and returns the received string.- Parameter:
dwCertEncodingType
- The certificate encoding type that was used to encode the name. The message encoding type identifier, contained in the high WORD of this value, is ignored by this function.dwStrType
- This parameter specifies the format of the output string. This parameter also specifies other options for the contents of the string.pName
- A pointer to the CERT_NAME_BLOB structure to be converted.- Gibt zurück:
- Returns the retrieved string.
-