public final class GenericProvider extends HdlSecurityProvider
ENCRYPT_ALG_AES, ENCRYPT_ALG_DES, ENCRYPT_ALG_DESEDE| Constructor and Description |
|---|
GenericProvider() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt_DES_ECB_PKCS5(byte[] ciphertext,
int offset,
int len,
byte[] secretKey)
Deprecated.
use the getEncryptCipher and getDecryptCipher methods now that
the java crypto API, and therefore the Cipher class, is standard and
included in java 1.4 and higher. Using a returned Cipher object will be
vastly more efficient than calling this method, which constructs a new
Cipher every time.
|
byte[] |
encrypt_DES_ECB_PKCS5(byte[] cleartext,
int offset,
int len,
byte[] secretKey)
Deprecated.
use the getEncryptCipher and getDecryptCipher methods now that
the java crypto API, and therefore the Cipher class, is standard and
included in java 1.4 and higher. Using a returned Cipher object will be
vastly more efficient than calling this method, which constructs a new
Cipher every time.
|
java.security.KeyPair |
generateDHKeyPair(java.math.BigInteger p,
java.math.BigInteger g) |
java.security.KeyPair |
generateDHKeyPair(int keySize) |
byte[] |
generateSecretKey(int keyAlg)
Generate and encode a secret key for use with the given algorithm
|
javax.crypto.Cipher |
getCipher(int algorithm,
byte[] secretKey,
int direction,
byte[] iv,
int majorProtocolVersion,
int minorProtocolVersion)
Construct and return a Cipher object, initialized to either decrypt or
encrypt using the given algorithm and secret key.
|
byte[] |
getDESKeyFromDH(javax.crypto.interfaces.DHPublicKey pub,
javax.crypto.interfaces.DHPrivateKey priv) |
int |
getIvSize(int algorithm,
int majorProtocolVersion,
int minorProtocolVersion)
Returns the length in bytes of the initialization vector used by the cipher generated by getCipher().
|
byte[] |
getKeyFromDH(javax.crypto.interfaces.DHPublicKey pub,
javax.crypto.interfaces.DHPrivateKey priv,
int algorithm)
Using the given diffie-hellman key pair, generate the secret key with the
algorithm ID (ENCRYPT_ALG_DES, ENCRYPT_ALG_AES or ENCRYPT_ALG_DESEDE) in the
first four bytes of the array
|
static void |
main(java.lang.String[] argv) |
decrypt_RSA_CBC_PKCS1, decrypt_RSA_ECB_PKCS1, encrypt_RSA_CBC_PKCS1, encrypt_RSA_ECB_PKCS1, generateRSAKeyPair, getCipher, getInstance, sign_RSA_MD5_PKCS1, sign_RSA_SHA1_PKCS1, verify_RSA_MD5_PKCS1, verify_RSA_SHA1_PKCS1public javax.crypto.Cipher getCipher(int algorithm,
byte[] secretKey,
int direction,
byte[] iv,
int majorProtocolVersion,
int minorProtocolVersion)
throws java.lang.Exception
getCipher in class HdlSecurityProviderjava.lang.Exceptionpublic int getIvSize(int algorithm,
int majorProtocolVersion,
int minorProtocolVersion)
HdlSecurityProvidergetIvSize in class HdlSecurityProviderpublic byte[] generateSecretKey(int keyAlg)
throws java.lang.Exception
generateSecretKey in class HdlSecurityProviderjava.lang.Exception@Deprecated
public byte[] encrypt_DES_ECB_PKCS5(byte[] cleartext,
int offset,
int len,
byte[] secretKey)
throws java.lang.Exception
HdlSecurityProviderencrypt_DES_ECB_PKCS5 in class HdlSecurityProviderjava.lang.Exception@Deprecated
public byte[] decrypt_DES_ECB_PKCS5(byte[] ciphertext,
int offset,
int len,
byte[] secretKey)
throws java.lang.Exception
HdlSecurityProviderdecrypt_DES_ECB_PKCS5 in class HdlSecurityProviderjava.lang.Exceptionpublic byte[] getDESKeyFromDH(javax.crypto.interfaces.DHPublicKey pub,
javax.crypto.interfaces.DHPrivateKey priv)
throws java.lang.Exception
getDESKeyFromDH in class HdlSecurityProviderjava.lang.Exceptionpublic byte[] getKeyFromDH(javax.crypto.interfaces.DHPublicKey pub,
javax.crypto.interfaces.DHPrivateKey priv,
int algorithm)
throws java.lang.Exception
getKeyFromDH in class HdlSecurityProviderjava.lang.Exceptionpublic java.security.KeyPair generateDHKeyPair(int keySize)
throws java.lang.Exception
generateDHKeyPair in class HdlSecurityProviderjava.lang.Exceptionpublic java.security.KeyPair generateDHKeyPair(java.math.BigInteger p,
java.math.BigInteger g)
throws java.lang.Exception
generateDHKeyPair in class HdlSecurityProviderjava.lang.Exceptionpublic static void main(java.lang.String[] argv)
throws java.lang.Exception
java.lang.Exception