Package org.apache.commons.crypto.random
Class OpenSslCryptoRandomNative
- java.lang.Object
-
- org.apache.commons.crypto.random.OpenSslCryptoRandomNative
-
final class OpenSslCryptoRandomNative extends java.lang.Object
JNI interface ofCryptoRandom
implementation for OpenSSL. The native method in this class is defined in OpenSslCryptoRandomNative.h (generated at build time by javah) and implemented in the file src/main/native/org/apache/commons/crypto/random/OpenSslCryptoRandomNative.c
-
-
Constructor Summary
Constructors Modifier Constructor Description private
OpenSslCryptoRandomNative()
The private constructor ofOpenSslCryptoRandomNative
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
initSR()
Declares a native method to initialize SR.static boolean
nextRandBytes(byte[] bytes)
Judges whether useOpenSslCryptoRandomNative
to generate the user-specified number of random bits.
-
-
-
Constructor Detail
-
OpenSslCryptoRandomNative
private OpenSslCryptoRandomNative()
The private constructor ofOpenSslCryptoRandomNative
.
-
-
Method Detail
-
initSR
public static void initSR()
Declares a native method to initialize SR.
-
nextRandBytes
public static boolean nextRandBytes(byte[] bytes)
Judges whether useOpenSslCryptoRandomNative
to generate the user-specified number of random bits.- Parameters:
bytes
- the array to be filled in with random bytes.- Returns:
- true if use
OpenSslCryptoRandomNative
to generate the user-specified number of random bits.
-
-