Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.iapi.services.crypto
Interface CipherProvider  view CipherProvider download CipherProvider.java


public interface CipherProvider

A CipherProvider is a wrapper for a Cipher class in JCE. This service is only available when run on JDK1.2 or beyond. To use this service, either the SunJCE or an alternative clean room implementation of the JCE must be installed. To use a CipherProvider to encrypt or decrypt, it needs 3 things: 1) A CipherProvider that is initialized to ENCRYPT or DECRYPT 2) A secret Key for the encryption/decryption 3) An Initialization Vector (IvParameterSpec) that is used to create some randomness in the encryption See $WS/docs/funcspec/mulan/configurableEncryption.html See http://java.sun.com/products/JDK/1.1/docs/guide/security/CryptoSpec.html See http://java.sun.com/products/JDK/1.2/docs/guide/security/CryptoSpec.html See http://java.sun.com/products/jdk/1.2/jce/index.html


Method Summary
 int decrypt(byte[] ciphertext, int offset, int length, byte[] cleartext, int outputOffset)
          Decrypt data - use only with Cipher that has been initialized with CipherFactory.DECRYPT.
 int encrypt(byte[] cleartext, int offset, int length, byte[] ciphertext, int outputOffset)
          Encrypt data - use only with Cipher that has been initialized with CipherFactory.ENCRYPT.
 int getEncryptionBlockSize()
          Returns the encryption block size used during creation of the encrypted database
 

Method Detail

encrypt

public int encrypt(byte[] cleartext,
                   int offset,
                   int length,
                   byte[] ciphertext,
                   int outputOffset)
            throws org.apache.derby.iapi.error.StandardException
Encrypt data - use only with Cipher that has been initialized with CipherFactory.ENCRYPT.


decrypt

public int decrypt(byte[] ciphertext,
                   int offset,
                   int length,
                   byte[] cleartext,
                   int outputOffset)
            throws org.apache.derby.iapi.error.StandardException
Decrypt data - use only with Cipher that has been initialized with CipherFactory.DECRYPT.


getEncryptionBlockSize

public int getEncryptionBlockSize()
Returns the encryption block size used during creation of the encrypted database