Package org.apache.commons.crypto.random
Class OpenSslCryptoRandomNative
java.lang.Object
org.apache.commons.crypto.random.OpenSslCryptoRandomNative
JNI interface of
CryptoRandom
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
OpenSslCryptoRandomNative
private OpenSslCryptoRandomNative()The private constructor ofOpenSslCryptoRandomNative
.
-
-
Method Details
-
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.
-