public class OpenSslAesCtr
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static byte[] |
BUFFER_INPUT
Empty static input buffer as source
|
protected static IntByReference |
BUFFER_SIZE_P
Buffer size as C reference.
|
protected Pointer |
evpCipherContext
Current cipher context.
|
static java.lang.String |
JNA_LIBRARY_NAME
OpenSSL Crypto lib name.
|
static NativeLibrary |
JNA_NATIVE_LIB
OpenSSL Crypto lib.
|
Constructor and Description |
---|
OpenSslAesCtr()
Create an instance.
|
Modifier and Type | Method and Description |
---|---|
static void |
ERR_load_crypto_strings() |
static void |
ERR_print_errors_fp(Pointer fp) |
static Pointer |
EVP_aes_128_ctr() |
static Pointer |
EVP_aes_256_ctr() |
static Pointer |
EVP_aes_256_ecb() |
static void |
EVP_CIPHER_CTX_free(Pointer ctx) |
static Pointer |
EVP_CIPHER_CTX_new() |
static int |
EVP_CIPHER_CTX_set_padding(Pointer context,
int padding) |
static int |
EVP_EncryptFinal_ex(Pointer ctx,
byte[] out,
IntByReference outlen) |
static int |
EVP_EncryptInit_ex(Pointer context,
Pointer ciphertype,
Pointer impl,
byte[] key,
byte[] iv) |
static int |
EVP_EncryptUpdate(Pointer context,
byte[] out,
IntByReference outlen,
byte[] in,
int inlen) |
void |
init(byte[] key,
byte[] iv)
Initialize the cipher.
|
static boolean |
isEnabled()
Checks if the library is in a usable state.
|
byte[] |
nextBytes()
Retrieves the next buffer of random values.
|
static void |
OpenSSL_add_all_ciphers() |
static void |
OPENSSL_config(java.lang.String config_name) |
public static final java.lang.String JNA_LIBRARY_NAME
public static final NativeLibrary JNA_NATIVE_LIB
protected static final byte[] BUFFER_INPUT
protected static final IntByReference BUFFER_SIZE_P
protected Pointer evpCipherContext
public static void ERR_load_crypto_strings()
public static void OpenSSL_add_all_ciphers()
public static void OPENSSL_config(java.lang.String config_name)
public static Pointer EVP_CIPHER_CTX_new()
public static void EVP_CIPHER_CTX_free(Pointer ctx)
public static int EVP_CIPHER_CTX_set_padding(Pointer context, int padding)
public static Pointer EVP_aes_256_ctr()
public static Pointer EVP_aes_128_ctr()
public static Pointer EVP_aes_256_ecb()
public static int EVP_EncryptInit_ex(Pointer context, Pointer ciphertype, Pointer impl, byte[] key, byte[] iv)
public static int EVP_EncryptUpdate(Pointer context, byte[] out, IntByReference outlen, byte[] in, int inlen)
public static int EVP_EncryptFinal_ex(Pointer ctx, byte[] out, IntByReference outlen)
public static void ERR_print_errors_fp(Pointer fp)
public static final boolean isEnabled()
public void init(byte[] key, byte[] iv)
key
- The key.iv
- The IV to use.public byte[] nextBytes()