Package org.activecomponents.udp
Class WinCrypt
- java.lang.Object
-
- org.activecomponents.udp.WinCrypt
-
public class WinCrypt extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
JNA_LIBRARY_NAME
static com.sun.jna.NativeLibrary
JNA_NATIVE_LIB
static int
PROV_RSA_FULL
-
Constructor Summary
Constructors Constructor Description WinCrypt()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.sun.jna.platform.win32.WinDef.BOOL
CryptAcquireContextW(com.sun.jna.Pointer phProv, com.sun.jna.WString pszContainer, com.sun.jna.WString pszProvider, int dwProvType, int dwFlags)
Acquires the crypt context.static com.sun.jna.platform.win32.WinDef.BOOL
CryptGenRandom(com.sun.jna.platform.win32.WinDef.ULONG hProv, int dwLen, com.sun.jna.Pointer pbBuffer)
Generates random data.static com.sun.jna.platform.win32.WinDef.BOOL
CryptReleaseContext(com.sun.jna.platform.win32.WinDef.ULONG hProv, int dwFlags)
Releases the crypt context.static byte[]
getRandomFromWindows(int numBytes)
Gets random numbers from Windows API.
-
-
-
Field Detail
-
JNA_LIBRARY_NAME
public static final java.lang.String JNA_LIBRARY_NAME
- See Also:
- Constant Field Values
-
JNA_NATIVE_LIB
public static final com.sun.jna.NativeLibrary JNA_NATIVE_LIB
-
PROV_RSA_FULL
public static final int PROV_RSA_FULL
- See Also:
- Constant Field Values
-
-
Method Detail
-
CryptAcquireContextW
public static com.sun.jna.platform.win32.WinDef.BOOL CryptAcquireContextW(com.sun.jna.Pointer phProv, com.sun.jna.WString pszContainer, com.sun.jna.WString pszProvider, int dwProvType, int dwFlags)
Acquires the crypt context.
-
CryptReleaseContext
public static com.sun.jna.platform.win32.WinDef.BOOL CryptReleaseContext(com.sun.jna.platform.win32.WinDef.ULONG hProv, int dwFlags)
Releases the crypt context.
-
CryptGenRandom
public static com.sun.jna.platform.win32.WinDef.BOOL CryptGenRandom(com.sun.jna.platform.win32.WinDef.ULONG hProv, int dwLen, com.sun.jna.Pointer pbBuffer)
Generates random data.
-
getRandomFromWindows
public static byte[] getRandomFromWindows(int numBytes)
Gets random numbers from Windows API.- Parameters:
numBytes
- Number of bytes requested.- Returns:
- Random data, null on failure.
-
-