|
Oracle Security Developer Tools Crypto Java API Reference 10g (10.1.4.0.1) B28171-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.crypto.core.Coder
oracle.security.crypto.core.Cipher
oracle.security.crypto.core.BlockCipher
oracle.security.crypto.core.DES
The DES (Digital Encryption Standard) cipher. The DES algorithm uses a 56-bit key for encryption and decryption.
DES_EDE
Field Summary |
Fields inherited from class oracle.security.crypto.core.BlockCipher |
blockSize, iv, paddingID |
Fields inherited from class oracle.security.crypto.core.Cipher |
CBC, decryptionKey, ECB, encryptionKey, key, mode, NULL_PADDING, PKCS5_PADDING, rbs |
Constructor Summary | |
DES() Creates an uninitialized DES instance. |
|
DES(int mode) Deprecated. Use the no-argument constructor and an initialize method instead |
Method Summary | |
java.lang.String |
algName() Returns the name of this algorithm: DES |
protected void |
decryptBlock(byte[] input, int inOff, byte[] output, int outOff) Performs the block cipher's basic decryption operation on one block of ciphertext placing the result in the output buffer. |
void |
decryptOp(byte[] in, int inOff, byte[] out, int outOff) Deprecated. Use a decrypt method instead. |
protected void |
encryptBlock(byte[] input, int inOff, byte[] output, int outOff) Performs the block cipher's basic encryption operation on one block of plaintext placing the result in the output buffer. |
void |
encryptOp(byte[] in, int inOff, byte[] out, int outOff) Deprecated. Use an encrypt method instead. |
void |
erase() Erases any sensitive information stored in this BlockCipher object. |
AlgorithmIdentifier |
getAlgID() Builds an AlgorithmIdentifier that is a "snapshot" of the Cipher's current configuration. |
void |
initialize(AlgorithmIdentifier algID, Key key) This method verifies the AlgorithmIdentifier's Object ID and configures the DES instance appropriately with the params of the AlgorithmIdentifier in addition to the Key. |
void |
initialize(AlgorithmIdentifier algID, SymmetricKey key, Padding.ID paddingID) This method verifies the AlgorithmIdentifier's Object ID and configures the DES instance appropriately with the params of the AlgorithmIdentifier in addition to the SymmetricKey and padding identifier. |
void |
setAlgID(AlgorithmIdentifier algID) Deprecated. Use an initialize method. |
void |
setDecryptionKey(Key key) Deprecated. Use an initialize method instead. |
void |
setEncryptionKey(Key key) Deprecated. Use an initialize method instead. |
void |
setKey(SymmetricKey key) Deprecated. Use an initialize method instead. |
void |
setMode(int mode) Deprecated. Modes should only be set when a BlockCipher is initialized. Use one of the initialize(...) methods instead. |
java.lang.String |
toString() |
Methods inherited from class oracle.security.crypto.core.BlockCipher |
blockSize, decrypt, decrypt, encrypt, encrypt, getBlockSize, getIV, getPadding, getPaddingID, setIV, setPadding |
Methods inherited from class oracle.security.crypto.core.Cipher |
assertDecryption, assertEncryption, cloneKey, decodeOp, decrypt, decrypt, decrypt, decryptOp, encodeOp, encrypt, encrypt, encrypt, encryptOp, getDecryptionKey, getEncryptionKey, getInstance, getInstance, getInstance, getInstance, getInstance, getKey, getMode, pad, releaseOp, setRandomBitsSource, unpad |
Methods inherited from class oracle.security.crypto.core.Coder |
decode, decode, encode, encode, initialize |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DES()
public DES(int mode)
mode
- Cipher.ECB or Cipher.CBCMethod Detail |
public void initialize(AlgorithmIdentifier algID, Key key) throws AlgorithmIdentifierException, InvalidKeyException
initialize
in class Cipher
algID
- is the AlgorithmIdentifier whose params will be used to configure the cipher.key
- is the SymmetricKey instance that will be cloned and used by the cipher internally. The internal instance will be erased when Cipher.erase()
is called.AlgorithmIdentifierException
- is thrown if the algID's OID isn't valid for the Cipher instance being initialized or if the params are not valid for the algID's OID.InvalidKeyException
- is thrown if there is a problem with the Key instance the Cipher is being initialized with.public void initialize(AlgorithmIdentifier algID, SymmetricKey key, Padding.ID paddingID) throws AlgorithmIdentifierException, InvalidKeyException, CipherException
initialize
in class BlockCipher
algID
- is the AlgorithmIdentifier whose params will be used to configure the cipher.key
- is the SymmetricKey instance that will be cloned and used by the cipher internally. The internal instance will be erased when Cipher.erase()
is called.paddingID
- is used to indicate the type of padding that the Cipher should use. Options are Padding.NONE or Padding.PKCS5. A Cipher must be re-initialized before being used with the other Padding type.AlgorithmIdentifierException
- is thrown if the algID's OID isn't valid for the Cipher instance being initialized or if the params are not valid for the algID's OID.InvalidKeyException
- is thrown if there is a problem with the Key instance the Cipher is being initialized with.CipherException
- is thrown if there's a problem initializing the Cipher with the given parameters.protected void decryptBlock(byte[] input, int inOff, byte[] output, int outOff) throws CipherException
BlockCipher
decryptBlock
in class BlockCipher
input
- buffer in which data to be decrypted is stored.inOff
- offset within input buffer of the start of data.output
- buffer to place the decrypted bytes inoutOff
- offset within output buffer where the encrypted bytes will be stored.CipherException
- is thrown if the Cipher is not initialized, length of data is not equal to the block size, etc.protected void encryptBlock(byte[] input, int inOff, byte[] output, int outOff) throws CipherException
BlockCipher
encryptBlock
in class BlockCipher
input
- buffer in which data to be encrypted is storedinOff
- offset within input buffer of the start of dataoutput
- buffer to place the encrypted bytes inoutOff
- offset within output buffer where the encrypted bytes will be storedCipherException
- is thrown if the Cipher is not initialized, length of data is not equal to the block size, etc.public java.lang.String algName()
algName
in class Coder
public void erase()
BlockCipher
erase
in class BlockCipher
public AlgorithmIdentifier getAlgID()
Cipher
Altering this AlgorithmIdentifier will have no effect on the state of the Cipher.
getAlgID
in class Cipher
public java.lang.String toString()
public void decryptOp(byte[] in, int inOff, byte[] out, int outOff) throws CipherException
Implementors must ensure that this method works correctly even if the 'in' and 'out' buffers coincide.
decryptOp
in class Cipher
in
- buffer in which data to be decrypted is stored.inOff
- offset within input buffer of the start of data.out
- buffer to place the decrypted bytes inoutOff
- offset within output buffer where the encrypted bytes will be stored.CipherException
- is thrown if the Cipher is not initialized, length of data is not equal to the block size, etc.public void encryptOp(byte[] in, int inOff, byte[] out, int outOff) throws CipherException
Implementors must ensure that this method works correctly even if the 'in' and 'out' buffers coincide.
encryptOp
in class Cipher
in
- buffer in which data to be encrypted is storedinOff
- offset within input buffer of the start of dataout
- buffer to place the encrypted bytes inoutOff
- offset within output buffer where the encrypted bytes will be storedCipherException
- is thrown if the Cipher is not initialized, length of data is not equal to the block size, etc.public void setAlgID(AlgorithmIdentifier algID) throws AlgorithmIdentifierException
setAlgID
in class Cipher
AlgorithmIdentifierException
public void setKey(SymmetricKey key) throws InvalidKeyException
setKey
in class Cipher
key
- the encryption/decryption keyInvalidKeyException
- is thrown if the the key is not valid for the Cipher instancepublic void setEncryptionKey(Key key) throws InvalidKeyException
setEncryptionKey
in class Cipher
key
- the encryption keyInvalidKeyException
- is thrown if the the key is not valid for the Cipher instancepublic void setDecryptionKey(Key key) throws InvalidKeyException
setDecryptionKey
in class Cipher
key
- the decryption keyInvalidKeyException
- is thrown if the the key is not valid for the Cipher instancepublic void setMode(int mode)
setMode
in class Cipher
|
Oracle Security Developer Tools Crypto Java API Reference 10g (10.1.4.0.1) B28171-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |