Skip navigation links

Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10668-05


oracle.security.crypto.core
Class PBE

java.lang.Object
  extended by oracle.security.crypto.core.PBE

Direct Known Subclasses:
PKCS12PBE, PKCS5PBE

public abstract class PBE
extends java.lang.Object

An abstract class for Password Based Encryption

See Also:
PKCS5PBE, PKCS12PBE

Field Summary
protected  PBEAlgorithmIdentifier algID
           
protected  AlgorithmIdentifier cipherAlgID
           
protected  AlgorithmIdentifier mdAlgID
           

 

Constructor Summary
protected PBE()
          Standard contstructor.

 

Method Summary
abstract  byte[] decrypt(java.lang.String password, byte[] data)
          Decrypt an array of bytes, and return the decrypted array of bytes.
abstract  PrivateKey decryptPrivateKey(java.lang.String password, byte[] encPrivKey)
          Decrypt a private key, and return the decrypted key.
abstract  SymmetricKey decryptSymmetricKey(java.lang.String password, byte[] encSymKey)
          Decrypt a symmetric key, and return the decrypted key.
abstract  byte[] encrypt(java.lang.String password, byte[] data)
          Encrypt an array of bytes, and return the encrypted array of bytes.
abstract  byte[] encryptPrivateKey(java.lang.String password, PrivateKey privKey)
          Encrypt a private key, and return the encrypted key.
abstract  byte[] encryptSymmetricKey(java.lang.String password, SymmetricKey symKey)
          Encrypt a symmetric key, and return the encrypted key.
 AlgorithmIdentifier getAlgID()
          Returns the algorithm identifier of this PBE.
static PBE getInstance(AlgorithmIdentifier algID)
          Creates a new PBE instance using the specified AlgorithmIdentifier.
abstract  void initialize(AlgorithmIdentifier algID)
          Initializes this PBE instance with the specified algorithm identifier.
abstract  void initialize(int mode)
          Initializes this PBE instance with the specified PBE parameters.
abstract  void initialize(int mode, byte[] salt, int iterationCount)
          Initializes this PBE instance with the specified PBE parameters.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

algID

protected PBEAlgorithmIdentifier algID

mdAlgID

protected AlgorithmIdentifier mdAlgID

cipherAlgID

protected AlgorithmIdentifier cipherAlgID

Constructor Detail

PBE

protected PBE()
Standard contstructor.

Method Detail

getInstance

public static PBE getInstance(AlgorithmIdentifier algID)
                       throws AlgorithmIdentifierException
Creates a new PBE instance using the specified AlgorithmIdentifier.
Parameters:
algID - The algorithm identifier to create the PBE. It should be a instance of PBEAlgorithmIdentifier.
Returns:
The newly created PBE instance.
Throws:
AlgorithmIdentifierException

initialize

public abstract void initialize(AlgorithmIdentifier algID)
                         throws AlgorithmIdentifierException
Initializes this PBE instance with the specified algorithm identifier.
Parameters:
algID - The algorithm identifier used to initialize this PBE. It should be a instance of PBEAlgorithmIdentifier.
Throws:
AlgorithmIdentifierException

initialize

public abstract void initialize(int mode,
                                byte[] salt,
                                int iterationCount)
                         throws AlgorithmIdentifierException
Initializes this PBE instance with the specified PBE parameters.
Parameters:
mode - The mode to use with this PBE. The mode can be a PKCS5PBE mode value or a PKCS12PBE mode value.
salt - The salt to use during the key generation.
iterationCount - The iteration count to use during the key generation.
Throws:
AlgorithmIdentifierException

initialize

public abstract void initialize(int mode)
                         throws AlgorithmIdentifierException
Initializes this PBE instance with the specified PBE parameters.
Parameters:
mode - The mode to use with this PBE. The mode can be a PKCS5PBE mode value or a PKCS12PBE mode value.
Throws:
AlgorithmIdentifierException

getAlgID

public AlgorithmIdentifier getAlgID()
Returns the algorithm identifier of this PBE.
Returns:
An AlgorithmIdentifier object representing the algorithm used with this PBE.

encryptPrivateKey

public abstract byte[] encryptPrivateKey(java.lang.String password,
                                         PrivateKey privKey)
                                  throws CipherException
Encrypt a private key, and return the encrypted key.
Parameters:
password - The password to use to generate the key.
privKey - The private key to encrypt.
Returns:
A byte array containing the encrypted private key.
Throws:
CipherException

decryptPrivateKey

public abstract PrivateKey decryptPrivateKey(java.lang.String password,
                                             byte[] encPrivKey)
                                      throws CipherException,
                                             java.io.IOException
Decrypt a private key, and return the decrypted key.
Parameters:
password - The password to use to generate the key.
encPrivKey - The byte array containing the encrypted private key.
Returns:
The decrypted private key.
Throws:
CipherException
java.io.IOException

encryptSymmetricKey

public abstract byte[] encryptSymmetricKey(java.lang.String password,
                                           SymmetricKey symKey)
                                    throws CipherException
Encrypt a symmetric key, and return the encrypted key.
Parameters:
password - The password to use to generate the key.
symKey - The symmetric key to encrypt.
Returns:
A byte array containing the encrypted symmetric key.
Throws:
CipherException

decryptSymmetricKey

public abstract SymmetricKey decryptSymmetricKey(java.lang.String password,
                                                 byte[] encSymKey)
                                          throws CipherException
Decrypt a symmetric key, and return the decrypted key.
Parameters:
password - The password to use to generate the key.
encSymKey - The byte array containing the encrypted symmetric key.
Returns:
The decrypted symmetric key.
Throws:
CipherException

encrypt

public abstract byte[] encrypt(java.lang.String password,
                               byte[] data)
                        throws CipherException
Encrypt an array of bytes, and return the encrypted array of bytes.
Parameters:
password - The password to use to generate the key.
data - The data to encrypt.
Returns:
The encrypted data.
Throws:
CipherException

decrypt

public abstract byte[] decrypt(java.lang.String password,
                               byte[] data)
                        throws CipherException
Decrypt an array of bytes, and return the decrypted array of bytes.
Parameters:
password - The password to use to generate the key.
data - The data to decrypt.
Returns:
The decrypted data.
Throws:
CipherException

Skip navigation links

Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10668-05


Copyright © 2005, 2013, Oracle. All rights reserved.