Save This Page
Home » openjdk-7 » com.sun.crypto » provider » [javadoc | source]
com.sun.crypto.provider
final class: PBECipherCore [javadoc | source]
java.lang.Object
   com.sun.crypto.provider.PBECipherCore
This class represents password-based encryption as defined by the PKCS #5 standard.
Constructor:
 PBECipherCore(String cipherAlg) throws NoSuchAlgorithmException, NoSuchPaddingException 
    Creates an instance of PBE Cipher using the specified CipherSpi instance.
Method from com.sun.crypto.provider.PBECipherCore Summary:
doFinal,   doFinal,   getBlockSize,   getIV,   getOutputSize,   getParameters,   init,   init,   setMode,   setPadding,   unwrap,   update,   update,   wrap
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.crypto.provider.PBECipherCore Detail:
 byte[] doFinal(byte[] input,
    int inputOffset,
    int inputLen) throws IllegalBlockSizeException, BadPaddingException 
    Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. The data is encrypted or decrypted, depending on how this cipher was initialized.

    The first inputLen bytes in the input buffer, starting at inputOffset, and any input bytes that may have been buffered during a previous update operation, are processed, with padding (if requested) being applied. The result is stored in a new buffer.

    The cipher is reset to its initial state (uninitialized) after this call.

 int doFinal(byte[] input,
    int inputOffset,
    int inputLen,
    byte[] output,
    int outputOffset) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException 
    Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. The data is encrypted or decrypted, depending on how this cipher was initialized.

    The first inputLen bytes in the input buffer, starting at inputOffset, and any input bytes that may have been buffered during a previous update operation, are processed, with padding (if requested) being applied. The result is stored in the output buffer, starting at outputOffset.

    The cipher is reset to its initial state (uninitialized) after this call.

 int getBlockSize() 
    Returns the block size (in bytes).
 byte[] getIV() 
    Returns the initialization vector (IV) in a new buffer.

    This is useful in the case where a random IV has been created (see init), or in the context of password-based encryption or decryption, where the IV is derived from a user-supplied password.

 int getOutputSize(int inputLen) 
    Returns the length in bytes that an output buffer would need to be in order to hold the result of the next update or doFinal operation, given the input length inputLen (in bytes).

    This call takes into account any unprocessed (buffered) data from a previous update call, and padding.

    The actual output length of the next update or doFinal call may be smaller than the length returned by this method.

 AlgorithmParameters getParameters() 
    Returns the parameters used with this cipher.

    The returned parameters may be the same that were used to initialize this cipher, or may contain the default set of parameters or a set of randomly generated parameters used by the underlying cipher implementation (provided that the underlying cipher implementation uses a default set of parameters or creates new parameters if it needs parameters but was not initialized with any).

  void init(int opmode,
    Key key,
    AlgorithmParameterSpec params,
    SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException 
    Initializes this cipher with a key, a set of algorithm parameters, and a source of randomness. The cipher is initialized for one of the following four operations: encryption, decryption, key wrapping or key unwrapping, depending on the value of opmode.

    If this cipher (including its underlying feedback or padding scheme) requires any random bytes, it will get them from random.

  void init(int opmode,
    Key key,
    AlgorithmParameters params,
    SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException 
  void setMode(String mode) throws NoSuchAlgorithmException 
    Sets the mode of this cipher. This algorithm can only be run in CBC mode.
  void setPadding(String paddingScheme) throws NoSuchPaddingException 
    Sets the padding mechanism of this cipher. This algorithm only uses PKCS #5 padding.
 Key unwrap(byte[] wrappedKey,
    String wrappedKeyAlgorithm,
    int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException 
    Unwrap a previously wrapped key.
 byte[] update(byte[] input,
    int inputOffset,
    int inputLen) 
    Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

    The first inputLen bytes in the input buffer, starting at inputOffset, are processed, and the result is stored in a new buffer.

 int update(byte[] input,
    int inputOffset,
    int inputLen,
    byte[] output,
    int outputOffset) throws ShortBufferException 
    Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

    The first inputLen bytes in the input buffer, starting at inputOffset, are processed, and the result is stored in the output buffer, starting at outputOffset.

 byte[] wrap(Key key) throws IllegalBlockSizeException, InvalidKeyException 
    Wrap a key.