|
Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10668-03 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
oracle.security.crypto.core.PBE
oracle.security.crypto.core.PKCS12PBE
public final class PKCS12PBE
Class to perform password-based encryption, as defined in the PKCS#12 specification.
| Field Summary | |
|---|---|
static int |
SHA_128RC2_CBCThe SHA1 with RC2 CBC 128 bits PKCS#12 mode. |
static int |
SHA_128RC4The SHA1 with RC4 128 bits PKCS#12 mode. |
static int |
SHA_2_3DES_CBCThe SHA1 with Triple DES CBC 112 bits PKCS#12 mode. |
static int |
SHA_3_3DES_CBCThe SHA1 with Triple DES CBC 168 bits PKCS#12 mode. |
static int |
SHA_40RC2_CBCThe SHA1 with RC2 CBC 40 bits PKCS#12 mode. |
static int |
SHA_40RC4The SHA1 with RC4 40 bits PKCS#12 mode. |
| Fields inherited from class oracle.security.crypto.core.PBE |
|---|
algID, cipherAlgID, mdAlgID |
| Constructor Summary | |
|---|---|
PKCS12PBE()Standard contstructor. |
|
| Method Summary | |
|---|---|
static byte[] |
createPKCS12MacKey(AlgorithmIdentifier algID, java.lang.String password, byte[] salt, int iterationCount, int keyLength)Creates a PKCS#12 MAC key according to the PKCS#12 specifications. |
byte[] |
decrypt(java.lang.String password, byte[] data)Decrypt an array of bytes, and return the decrypted array of bytes. |
PrivateKey |
decryptPrivateKey(java.lang.String password, byte[] encPrivKey)Decrypt a private key, and return the decrypted key. |
SymmetricKey |
decryptSymmetricKey(java.lang.String password, byte[] encSymKey)Decrypt a symmetric key, and return the decrypted key. |
byte[] |
encrypt(java.lang.String password, byte[] data)Encrypt an array of bytes, and return the encrypted array of bytes. |
byte[] |
encryptPrivateKey(java.lang.String password, PrivateKey privKey)Encrypt a private key, and return the encrypted key. |
byte[] |
encryptSymmetricKey(java.lang.String password, SymmetricKey symKey)Encrypt a symmetric key, and return the encrypted key. |
void |
initialize(AlgorithmIdentifier algID)Initializes this PBE instance with the specified algorithm identifier. |
void |
initialize(int mode)Initializes this PBE instance with the specified PBE parameters. |
void |
initialize(int mode, byte[] salt, int iterationCount)Initializes this PBE instance with the specified PBE parameters. |
| Methods inherited from class oracle.security.crypto.core.PBE |
|---|
getAlgID, getInstance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SHA_128RC4
public static final int SHA_40RC4
public static final int SHA_3_3DES_CBC
public static final int SHA_2_3DES_CBC
public static final int SHA_128RC2_CBC
public static final int SHA_40RC2_CBC
| Constructor Detail |
|---|
public PKCS12PBE()
| Method Detail |
|---|
public void initialize(AlgorithmIdentifier algID)
throws AlgorithmIdentifierException
PBE instance with the specified algorithm identifier.initialize in class PBEalgID - The algorithm identifier used to initialize this PBE. It should be a instance of PBEAlgorithmIdentifier.AlgorithmIdentifierException
public void initialize(int mode,
byte[] salt,
int iterationCount)
throws AlgorithmIdentifierException
PBE instance with the specified PBE parameters.initialize in class PBEmode - The mode to use with this PBE. The mode is a PKCS12PBE mode value.salt - The salt to use during the key generation.iterationCount - The iteration count to use during the key generation.AlgorithmIdentifierException
public void initialize(int mode)
throws AlgorithmIdentifierException
PBE instance with the specified PBE parameters.initialize in class PBEmode - The mode to use with this PBE. The mode is a PKCS12PBE mode value.AlgorithmIdentifierException
public byte[] encrypt(java.lang.String password,
byte[] data)
throws CipherException
encrypt in class PBEpassword - The password to use to generate the key.data - The data to encrypt.CipherException
public byte[] decrypt(java.lang.String password,
byte[] data)
throws CipherException
decrypt in class PBEpassword - The password to use to generate the key.data - The data to decrypt.CipherException
public byte[] encryptPrivateKey(java.lang.String password,
PrivateKey privKey)
throws CipherException
encryptPrivateKey in class PBEpassword - The password to use to generate the key.privKey - The private key to encrypt.CipherException
public PrivateKey decryptPrivateKey(java.lang.String password,
byte[] encPrivKey)
throws CipherException,
java.io.IOException
decryptPrivateKey in class PBEpassword - The password to use to generate the key.encPrivKey - The byte array containing the encrypted private key.CipherExceptionjava.io.IOException
public byte[] encryptSymmetricKey(java.lang.String password,
SymmetricKey symKey)
throws CipherException
encryptSymmetricKey in class PBEpassword - The password to use to generate the key.symKey - The symmetric key to encrypt.CipherException
public SymmetricKey decryptSymmetricKey(java.lang.String password,
byte[] encSymKey)
throws CipherException
decryptSymmetricKey in class PBEpassword - The password to use to generate the key.encSymKey - The byte array containing the encrypted symmetric key.CipherException
public static byte[] createPKCS12MacKey(AlgorithmIdentifier algID,
java.lang.String password,
byte[] salt,
int iterationCount,
int keyLength)
throws CipherException
algID - The message digest algorithm identifier to use to generate the key. It is typically SHA1.password - The password to use to generate the key.salt - The salt value to use during the key generation.iterationCount - The iteration count to use during the key generation.keyLength - The length of the key material that will be returned,CipherException
|
Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10668-03 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||