Package jadex.commons.security.random
Class OpenSslAesCtr
- java.lang.Object
- 
- jadex.commons.security.random.OpenSslAesCtr
 
- 
 public class OpenSslAesCtr extends java.lang.ObjectAccess to OpenSSL AES counter mode.
- 
- 
Field SummaryFields Modifier and Type Field Description protected static byte[]BUFFER_INPUTEmpty static input buffer as sourceprotected static com.sun.jna.ptr.IntByReferenceBUFFER_SIZE_PBuffer size as C reference.protected com.sun.jna.PointerevpCipherContextCurrent cipher context.static java.lang.StringJNA_LIBRARY_NAMEOpenSSL Crypto lib name.static com.sun.jna.NativeLibraryJNA_NATIVE_LIBOpenSSL Crypto lib.
 - 
Constructor SummaryConstructors Constructor Description OpenSslAesCtr()Create an instance.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidERR_load_crypto_strings()static voidERR_print_errors_fp(com.sun.jna.Pointer fp)static com.sun.jna.PointerEVP_aes_128_ctr()static com.sun.jna.PointerEVP_aes_256_ctr()static com.sun.jna.PointerEVP_aes_256_ecb()static voidEVP_CIPHER_CTX_free(com.sun.jna.Pointer ctx)static com.sun.jna.PointerEVP_CIPHER_CTX_new()static intEVP_CIPHER_CTX_set_padding(com.sun.jna.Pointer context, int padding)static intEVP_EncryptFinal_ex(com.sun.jna.Pointer ctx, byte[] out, com.sun.jna.ptr.IntByReference outlen)static intEVP_EncryptInit_ex(com.sun.jna.Pointer context, com.sun.jna.Pointer ciphertype, com.sun.jna.Pointer impl, byte[] key, byte[] iv)static intEVP_EncryptUpdate(com.sun.jna.Pointer context, byte[] out, com.sun.jna.ptr.IntByReference outlen, byte[] in, int inlen)voidinit(byte[] key, byte[] iv)Initialize the cipher.static booleanisEnabled()Checks if the library is in a usable state.byte[]nextBytes()Retrieves the next buffer of random values.static voidOpenSSL_add_all_ciphers()static voidOPENSSL_config(java.lang.String config_name)
 
- 
- 
- 
Field Detail- 
JNA_LIBRARY_NAMEpublic static final java.lang.String JNA_LIBRARY_NAME OpenSSL Crypto lib name.- See Also:
- Constant Field Values
 
 - 
JNA_NATIVE_LIBpublic static final com.sun.jna.NativeLibrary JNA_NATIVE_LIB OpenSSL Crypto lib.
 - 
BUFFER_INPUTprotected static final byte[] BUFFER_INPUT Empty static input buffer as source
 - 
BUFFER_SIZE_Pprotected static final com.sun.jna.ptr.IntByReference BUFFER_SIZE_P Buffer size as C reference.
 - 
evpCipherContextprotected com.sun.jna.Pointer evpCipherContext Current cipher context.
 
- 
 - 
Method Detail- 
ERR_load_crypto_stringspublic static void ERR_load_crypto_strings() 
 - 
OpenSSL_add_all_cipherspublic static void OpenSSL_add_all_ciphers() 
 - 
OPENSSL_configpublic static void OPENSSL_config(java.lang.String config_name) 
 - 
EVP_CIPHER_CTX_newpublic static com.sun.jna.Pointer EVP_CIPHER_CTX_new() 
 - 
EVP_CIPHER_CTX_freepublic static void EVP_CIPHER_CTX_free(com.sun.jna.Pointer ctx) 
 - 
EVP_CIPHER_CTX_set_paddingpublic static int EVP_CIPHER_CTX_set_padding(com.sun.jna.Pointer context, int padding)
 - 
EVP_aes_256_ctrpublic static com.sun.jna.Pointer EVP_aes_256_ctr() 
 - 
EVP_aes_128_ctrpublic static com.sun.jna.Pointer EVP_aes_128_ctr() 
 - 
EVP_aes_256_ecbpublic static com.sun.jna.Pointer EVP_aes_256_ecb() 
 - 
EVP_EncryptInit_expublic static int EVP_EncryptInit_ex(com.sun.jna.Pointer context, com.sun.jna.Pointer ciphertype, com.sun.jna.Pointer impl, byte[] key, byte[] iv)
 - 
EVP_EncryptUpdatepublic static int EVP_EncryptUpdate(com.sun.jna.Pointer context, byte[] out, com.sun.jna.ptr.IntByReference outlen, byte[] in, int inlen)
 - 
EVP_EncryptFinal_expublic static int EVP_EncryptFinal_ex(com.sun.jna.Pointer ctx, byte[] out, com.sun.jna.ptr.IntByReference outlen)
 - 
ERR_print_errors_fppublic static void ERR_print_errors_fp(com.sun.jna.Pointer fp) 
 - 
isEnabledpublic static final boolean isEnabled() Checks if the library is in a usable state.
 - 
initpublic void init(byte[] key, byte[] iv)Initialize the cipher.- Parameters:
- key- The key.
- iv- The IV to use.
 
 - 
nextBytespublic byte[] nextBytes() Retrieves the next buffer of random values.- Returns:
- The next buffer of random values.
 
 
- 
 
-