public abstract class Crypt32Util
extends java.lang.Object
Constructor and Description |
---|
Crypt32Util() |
Modifier and Type | Method and Description |
---|---|
static java.lang.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,
java.lang.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.
|
public static byte[] cryptProtectData(byte[] data)
data
- Data to protect.public static byte[] cryptProtectData(byte[] data, int flags)
data
- Data to protect.flags
- Optional flags, eg. CRYPTPROTECT_LOCAL_MACHINE | CRYPTPROTECT_UI_FORBIDDEN.public static byte[] cryptProtectData(byte[] data, byte[] entropy, int flags, java.lang.String description, WinCrypt.CRYPTPROTECT_PROMPTSTRUCT prompt)
data
- Data to protect.entropy
- Optional entropy.flags
- Optional flags.description
- Optional description.prompt
- Prompt structure.public static byte[] cryptUnprotectData(byte[] data)
data
- Data to unprotect.public static byte[] cryptUnprotectData(byte[] data, int flags)
data
- Data to unprotect.flags
- Optional flags, eg. CRYPTPROTECT_UI_FORBIDDEN.public static byte[] cryptUnprotectData(byte[] data, byte[] entropy, int flags, WinCrypt.CRYPTPROTECT_PROMPTSTRUCT prompt)
data
- Data to unprotect.entropy
- Optional entropy.flags
- Optional flags.prompt
- Optional prompt structure.public static java.lang.String CertNameToStr(int dwCertEncodingType, int dwStrType, WinCrypt.DATA_BLOB pName)
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.pName
- A pointer to the CERT_NAME_BLOB structure to be converted.dwStrType
- This parameter specifies the format of the output
string. This parameter also specifies other options for the contents of
the string.