Class Crypt32
dpapi.h and crypt32.dll.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classContains the function pointers loaded from the crypt32SharedLibrary. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFlags for thedwFlagsparameter ofCryptProtectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, java.nio.ByteBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB)and/orCryptUnprotectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, org.lwjgl.PointerBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB).static final intFlags for thedwFlagsparameter ofCryptProtectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, java.nio.ByteBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB)and/orCryptUnprotectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, org.lwjgl.PointerBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB).static final intFlags for thedwPromptFlagsmember ofDATA_BLOB.static final intFlags for thedwPromptFlagsmember ofDATA_BLOB.static final intFlags for thedwFlagsparameter ofCryptProtectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, java.nio.ByteBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB)and/orCryptUnprotectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, org.lwjgl.PointerBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB).static final intFlags for thedwFlagsparameter ofCryptProtectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, java.nio.ByteBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB)and/orCryptUnprotectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, org.lwjgl.PointerBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB).static final intThe block size for data encrypted viaCryptProtectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int).static final intFlags for thedwFlagsparameter ofCryptProtectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)andCryptUnprotectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int).static final intFlags for thedwFlagsparameter ofCryptProtectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)andCryptUnprotectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int).static final intFlags for thedwFlagsparameter ofCryptProtectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)andCryptUnprotectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int). -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCryptProtectData(@Nullable IntBuffer _GetLastError, DATA_BLOB pDataIn, @Nullable CharSequence szDataDescr, @Nullable DATA_BLOB pOptionalEntropy, long pvReserved, @Nullable CRYPTPROTECT_PROMPTSTRUCT pPromptStruct, int dwFlags, DATA_BLOB pDataOut) TheCryptProtectDatafunction performs encryption on the data in aDATA_BLOBstructure.static booleanCryptProtectData(@Nullable IntBuffer _GetLastError, DATA_BLOB pDataIn, @Nullable ByteBuffer szDataDescr, @Nullable DATA_BLOB pOptionalEntropy, long pvReserved, @Nullable CRYPTPROTECT_PROMPTSTRUCT pPromptStruct, int dwFlags, DATA_BLOB pDataOut) TheCryptProtectDatafunction performs encryption on the data in aDATA_BLOBstructure.static booleanCryptProtectMemory(@Nullable IntBuffer _GetLastError, ByteBuffer pDataIn, int dwFlags) Encrypts memory to prevent others from viewing sensitive information in your process.static booleanCryptUnprotectData(@Nullable IntBuffer _GetLastError, DATA_BLOB pDataIn, @Nullable org.lwjgl.PointerBuffer ppszDataDescr, @Nullable DATA_BLOB pOptionalEntropy, long pvReserved, @Nullable CRYPTPROTECT_PROMPTSTRUCT pPromptStruct, int dwFlags, DATA_BLOB pDataOut) TheCryptUnprotectDatafunction decrypts and does an integrity check of the data in aDATA_BLOBstructure.static booleanCryptUnprotectMemory(@Nullable IntBuffer _GetLastError, ByteBuffer pDataIn, int dwFlags) TheCryptUnprotectMemoryfunction decrypts memory that was encrypted using theCryptProtectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)function.static org.lwjgl.system.SharedLibraryReturns the crypt32SharedLibrary.static intnCryptProtectData(long _GetLastError, long pDataIn, long szDataDescr, long pOptionalEntropy, long pvReserved, long pPromptStruct, int dwFlags, long pDataOut) static intnCryptProtectData(long _GetLastError, long pDataIn, long szDataDescr, long pOptionalEntropy, long pvReserved, long pPromptStruct, int dwFlags, long pDataOut, long __functionAddress) static intnCryptProtectMemory(long _GetLastError, long pDataIn, int cbDataIn, int dwFlags) Unsafe version of:CryptProtectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)static intnCryptProtectMemory(long _GetLastError, long pDataIn, int cbDataIn, int dwFlags, long __functionAddress) Unsafe version of:CryptProtectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)static intnCryptUnprotectData(long _GetLastError, long pDataIn, long ppszDataDescr, long pOptionalEntropy, long pvReserved, long pPromptStruct, int dwFlags, long pDataOut) static intnCryptUnprotectData(long _GetLastError, long pDataIn, long ppszDataDescr, long pOptionalEntropy, long pvReserved, long pPromptStruct, int dwFlags, long pDataOut, long __functionAddress) static intnCryptUnprotectMemory(long _GetLastError, long pDataIn, int cbDataIn, int dwFlags) Unsafe version of:CryptUnprotectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)static intnCryptUnprotectMemory(long _GetLastError, long pDataIn, int cbDataIn, int dwFlags, long __functionAddress) Unsafe version of:CryptUnprotectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)
-
Field Details
-
CRYPTPROTECT_UI_FORBIDDEN
public static final int CRYPTPROTECT_UI_FORBIDDENFlags for thedwFlagsparameter ofCryptProtectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, java.nio.ByteBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB)and/orCryptUnprotectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, org.lwjgl.PointerBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB).- See Also:
-
CRYPTPROTECT_LOCAL_MACHINE
public static final int CRYPTPROTECT_LOCAL_MACHINEFlags for thedwFlagsparameter ofCryptProtectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, java.nio.ByteBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB)and/orCryptUnprotectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, org.lwjgl.PointerBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB).- See Also:
-
CRYPTPROTECT_AUDIT
public static final int CRYPTPROTECT_AUDITFlags for thedwFlagsparameter ofCryptProtectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, java.nio.ByteBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB)and/orCryptUnprotectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, org.lwjgl.PointerBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB).- See Also:
-
CRYPTPROTECT_VERIFY_PROTECTION
public static final int CRYPTPROTECT_VERIFY_PROTECTIONFlags for thedwFlagsparameter ofCryptProtectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, java.nio.ByteBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB)and/orCryptUnprotectData(java.nio.IntBuffer, org.lwjgl.system.windows.DATA_BLOB, org.lwjgl.PointerBuffer, org.lwjgl.system.windows.DATA_BLOB, long, org.lwjgl.system.windows.CRYPTPROTECT_PROMPTSTRUCT, int, org.lwjgl.system.windows.DATA_BLOB).- See Also:
-
CRYPTPROTECTMEMORY_SAME_PROCESS
public static final int CRYPTPROTECTMEMORY_SAME_PROCESSFlags for thedwFlagsparameter ofCryptProtectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)andCryptUnprotectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int).- See Also:
-
CRYPTPROTECTMEMORY_CROSS_PROCESS
public static final int CRYPTPROTECTMEMORY_CROSS_PROCESSFlags for thedwFlagsparameter ofCryptProtectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)andCryptUnprotectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int).- See Also:
-
CRYPTPROTECTMEMORY_SAME_LOGON
public static final int CRYPTPROTECTMEMORY_SAME_LOGONFlags for thedwFlagsparameter ofCryptProtectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)andCryptUnprotectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int).- See Also:
-
CRYPTPROTECT_PROMPT_ON_UNPROTECT
public static final int CRYPTPROTECT_PROMPT_ON_UNPROTECTFlags for thedwPromptFlagsmember ofDATA_BLOB.- See Also:
-
CRYPTPROTECT_PROMPT_ON_PROTECT
public static final int CRYPTPROTECT_PROMPT_ON_PROTECTFlags for thedwPromptFlagsmember ofDATA_BLOB.- See Also:
-
CRYPTPROTECTMEMORY_BLOCK_SIZE
public static final int CRYPTPROTECTMEMORY_BLOCK_SIZEThe block size for data encrypted viaCryptProtectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int).- See Also:
-
-
Method Details
-
getLibrary
public static org.lwjgl.system.SharedLibrary getLibrary()Returns the crypt32SharedLibrary. -
nCryptProtectData
public static int nCryptProtectData(long _GetLastError, long pDataIn, long szDataDescr, long pOptionalEntropy, long pvReserved, long pPromptStruct, int dwFlags, long pDataOut, long __functionAddress) -
nCryptProtectData
public static int nCryptProtectData(long _GetLastError, long pDataIn, long szDataDescr, long pOptionalEntropy, long pvReserved, long pPromptStruct, int dwFlags, long pDataOut) -
CryptProtectData
public static boolean CryptProtectData(@Nullable IntBuffer _GetLastError, DATA_BLOB pDataIn, @Nullable ByteBuffer szDataDescr, @Nullable DATA_BLOB pOptionalEntropy, long pvReserved, @Nullable CRYPTPROTECT_PROMPTSTRUCT pPromptStruct, int dwFlags, DATA_BLOB pDataOut) TheCryptProtectDatafunction performs encryption on the data in aDATA_BLOBstructure.Typically, only a user with the same logon credential as the user who encrypted the data can decrypt the data. In addition, the encryption and decryption usually must be done on the same computer.
- Parameters:
_GetLastError- optionally returns the result ofGetLastError()after this function is calledpDataIn- a pointer to aDATA_BLOBstructure that contains the plaintext to be encryptedszDataDescr- a string with a readable description of the data to be encrypted.This description string is included with the encrypted data. This parameter is optional and can be set to
NULL.pOptionalEntropy- a pointer to aDATA_BLOBstructure that contains a password or other additional entropy used to encrypt the data.The
DATA_BLOBstructure used in the encryption phase must also be used in the decryption phase. This parameter can be set toNULLfor no additional entropy.pvReserved- reserved for future use and must be set toNULLpPromptStruct- a pointer to aCRYPTPROTECT_PROMPTSTRUCTstructure that provides information about where and when prompts are to be displayed and what the content of those prompts should be.This parameter can be set to
NULLin both the encryption and decryption phases.dwFlags- one or more of:CRYPTPROTECT_LOCAL_MACHINE,CRYPTPROTECT_UI_FORBIDDEN,CRYPTPROTECT_AUDITpDataOut- a pointer to aDATA_BLOBstructure that receives the encrypted data.When you have finished using the
DATA_BLOBstructure, free itspbDatamember by calling theWinBase.LocalFree(java.nio.IntBuffer, long)function.
-
CryptProtectData
public static boolean CryptProtectData(@Nullable IntBuffer _GetLastError, DATA_BLOB pDataIn, @Nullable CharSequence szDataDescr, @Nullable DATA_BLOB pOptionalEntropy, long pvReserved, @Nullable CRYPTPROTECT_PROMPTSTRUCT pPromptStruct, int dwFlags, DATA_BLOB pDataOut) TheCryptProtectDatafunction performs encryption on the data in aDATA_BLOBstructure.Typically, only a user with the same logon credential as the user who encrypted the data can decrypt the data. In addition, the encryption and decryption usually must be done on the same computer.
- Parameters:
_GetLastError- optionally returns the result ofGetLastError()after this function is calledpDataIn- a pointer to aDATA_BLOBstructure that contains the plaintext to be encryptedszDataDescr- a string with a readable description of the data to be encrypted.This description string is included with the encrypted data. This parameter is optional and can be set to
NULL.pOptionalEntropy- a pointer to aDATA_BLOBstructure that contains a password or other additional entropy used to encrypt the data.The
DATA_BLOBstructure used in the encryption phase must also be used in the decryption phase. This parameter can be set toNULLfor no additional entropy.pvReserved- reserved for future use and must be set toNULLpPromptStruct- a pointer to aCRYPTPROTECT_PROMPTSTRUCTstructure that provides information about where and when prompts are to be displayed and what the content of those prompts should be.This parameter can be set to
NULLin both the encryption and decryption phases.dwFlags- one or more of:CRYPTPROTECT_LOCAL_MACHINE,CRYPTPROTECT_UI_FORBIDDEN,CRYPTPROTECT_AUDITpDataOut- a pointer to aDATA_BLOBstructure that receives the encrypted data.When you have finished using the
DATA_BLOBstructure, free itspbDatamember by calling theWinBase.LocalFree(java.nio.IntBuffer, long)function.
-
nCryptProtectMemory
public static int nCryptProtectMemory(long _GetLastError, long pDataIn, int cbDataIn, int dwFlags, long __functionAddress) Unsafe version of:CryptProtectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)- Parameters:
cbDataIn- number of bytes of memory pointed to by thepDataparameter to encrypt.The number of bytes must be a multiple of the
CRYPTPROTECTMEMORY_BLOCK_SIZEconstant.
-
nCryptProtectMemory
public static int nCryptProtectMemory(long _GetLastError, long pDataIn, int cbDataIn, int dwFlags) Unsafe version of:CryptProtectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)- Parameters:
cbDataIn- number of bytes of memory pointed to by thepDataparameter to encrypt.The number of bytes must be a multiple of the
CRYPTPROTECTMEMORY_BLOCK_SIZEconstant.
-
CryptProtectMemory
public static boolean CryptProtectMemory(@Nullable IntBuffer _GetLastError, ByteBuffer pDataIn, int dwFlags) Encrypts memory to prevent others from viewing sensitive information in your process.For example, use the
CryptProtectMemoryfunction to encrypt memory that contains a password. Encrypting the password prevents others from viewing it when the process is paged out to the swap file. Otherwise, the password is in plaintext and viewable by others.- Parameters:
_GetLastError- optionally returns the result ofGetLastError()after this function is calledpDataIn- a pointer to the block of memory to encryptdwFlags- this parameter can be one of the following flags. You must specify the same flag when encrypting and decrypting the memory. One of:CRYPTPROTECTMEMORY_SAME_PROCESSCRYPTPROTECTMEMORY_CROSS_PROCESSCRYPTPROTECTMEMORY_SAME_LOGON
-
nCryptUnprotectData
public static int nCryptUnprotectData(long _GetLastError, long pDataIn, long ppszDataDescr, long pOptionalEntropy, long pvReserved, long pPromptStruct, int dwFlags, long pDataOut, long __functionAddress) -
nCryptUnprotectData
public static int nCryptUnprotectData(long _GetLastError, long pDataIn, long ppszDataDescr, long pOptionalEntropy, long pvReserved, long pPromptStruct, int dwFlags, long pDataOut) -
CryptUnprotectData
public static boolean CryptUnprotectData(@Nullable IntBuffer _GetLastError, DATA_BLOB pDataIn, @Nullable org.lwjgl.PointerBuffer ppszDataDescr, @Nullable DATA_BLOB pOptionalEntropy, long pvReserved, @Nullable CRYPTPROTECT_PROMPTSTRUCT pPromptStruct, int dwFlags, DATA_BLOB pDataOut) TheCryptUnprotectDatafunction decrypts and does an integrity check of the data in aDATA_BLOBstructure.Usually, the only user who can decrypt the data is a user with the same logon credentials as the user who encrypted the data. In addition, the encryption and decryption must be done on the same computer.
- Parameters:
_GetLastError- optionally returns the result ofGetLastError()after this function is calledpDataIn- a pointer to aDATA_BLOBstructure that holds the encrypted datappszDataDescr- a pointer to a string-readable description of the encrypted data included with the encrypted data.This parameter can be set to
NULL. When you have finished usingppszDataDescr, free it by calling theWinBase.LocalFree(java.nio.IntBuffer, long)function.pOptionalEntropy- a pointer to aDATA_BLOBstructure that contains a password or other additional entropy used when the data was encrypted.This parameter can be set to
NULL; however, if an optional entropyDATA_BLOBstructure was used in the encryption phase, that sameDATA_BLOBstructure must be used for the decryption phase.pvReserved- reserved for future use and must be set toNULLpPromptStruct- a pointer to aCRYPTPROTECT_PROMPTSTRUCTstructure that provides information about where and when prompts are to be displayed and what the content of those prompts should be.This parameter can be set to
NULL.dwFlags- one or more of:CRYPTPROTECT_UI_FORBIDDENCRYPTPROTECT_VERIFY_PROTECTIONpDataOut- a pointer to aDATA_BLOBstructure where the function stores the decrypted data.When you have finished using the
DATA_BLOBstructure, free itspbDatamember by calling theWinBase.LocalFree(java.nio.IntBuffer, long)function.
-
nCryptUnprotectMemory
public static int nCryptUnprotectMemory(long _GetLastError, long pDataIn, int cbDataIn, int dwFlags, long __functionAddress) Unsafe version of:CryptUnprotectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)- Parameters:
cbDataIn- number of bytes of memory pointed to by thepDataparameter to decrypt.The number of bytes must be a multiple of the
CRYPTPROTECTMEMORY_BLOCK_SIZEconstant.
-
nCryptUnprotectMemory
public static int nCryptUnprotectMemory(long _GetLastError, long pDataIn, int cbDataIn, int dwFlags) Unsafe version of:CryptUnprotectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)- Parameters:
cbDataIn- number of bytes of memory pointed to by thepDataparameter to decrypt.The number of bytes must be a multiple of the
CRYPTPROTECTMEMORY_BLOCK_SIZEconstant.
-
CryptUnprotectMemory
public static boolean CryptUnprotectMemory(@Nullable IntBuffer _GetLastError, ByteBuffer pDataIn, int dwFlags) TheCryptUnprotectMemoryfunction decrypts memory that was encrypted using theCryptProtectMemory(java.nio.IntBuffer, java.nio.ByteBuffer, int)function.- Parameters:
_GetLastError- optionally returns the result ofGetLastError()after this function is calledpDataIn- a pointer to the block of memory to decryptdwFlags- this parameter can be one of the following flags. You must specify the same flag when encrypting and decrypting the memory. One of:CRYPTPROTECTMEMORY_SAME_PROCESSCRYPTPROTECTMEMORY_CROSS_PROCESSCRYPTPROTECTMEMORY_SAME_LOGON
-