public class CkiRSApkcs1
extends oracle.security.crypto.core.Cipher
Constructor and Description |
---|
CkiRSApkcs1()
Creates a new CkiRSApkcs1 object.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
algName()
The algorithm for which this key is used.
|
int |
blockSize()
Deprecated.
|
byte[] |
decrypt(byte[] bytes)
Decrypts the given encrypted block with the decryption key.
|
byte[] |
decrypt(byte[] bytes, int inOff, int len, boolean unpad)
Decrypts a sequence of bytes of specified length.
|
void |
decrypt(byte[] input, int inOff, int len, byte[] output, int outOff)
Decrypts a sequence of bytes of specified length and places the original plaintext message in the given output buffer starting at the given offset.
|
void |
decryptOp(byte[] in, int inOff, byte[] out, int outOff)
Deprecated.
|
byte[] |
encrypt(byte[] bytes)
Encrypts the given data with the encryption key.
|
byte[] |
encrypt(byte[] bytes, int inOff, int len, boolean pad)
Encrypts a sequence of bytes of specified length.
|
void |
encrypt(byte[] input, int inOff, int len, byte[] output, int outOff)
Encrypts a sequence of bytes of specified length and places the resulting ciphertext in the given output buffer starting at the given offset.
|
void |
encryptOp(byte[] in, int inOff, byte[] out, int outOff)
Deprecated.
|
void |
erase()
Erase the keys.
|
void |
finalize() |
oracle.security.crypto.core.AlgorithmIdentifier |
getAlgID()
Returns the algorithm identifier for this key.
|
int |
getBlockSize()
The blocksize returns 0.
|
void |
initialize(oracle.security.crypto.core.AlgorithmIdentifier algID, oracle.security.crypto.core.Key key)
This method initializes the cipher with the given AlgorithmIdentifier and then configures itself with the given key.
|
void |
setAlgID(oracle.security.crypto.core.AlgorithmIdentifier algID)
Deprecated.
Use an initialize method.
|
void |
setDecryptionKey(oracle.security.crypto.core.Key key)
Deprecated.
Use an initialize method instead.
|
void |
setEncryptionKey(oracle.security.crypto.core.Key key)
Deprecated.
Use an initialize method instead.
|
void |
setKey(oracle.security.crypto.core.SymmetricKey key)
Deprecated.
Use an initialize method instead.
|
void |
setSession(CkiMgtSession session)
Sets the session to be used within this Cipher object.
|
c, cloneKey, d, decodeOp, decrypt, decrypt, e, encodeOp, encrypt, encrypt, f, g, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getIV, getMode, getPaddingID, initialize, initialize, initialize, unwrapPrivateKey, unwrapSymmetricKey, wrapKey, wrapKey
public void initialize(oracle.security.crypto.core.AlgorithmIdentifier algID, oracle.security.crypto.core.Key key) throws oracle.security.crypto.core.AlgorithmIdentifierException, oracle.security.crypto.core.InvalidKeyException, oracle.security.crypto.core.CipherException
initialize
in class oracle.security.crypto.core.Cipher
algID
- is the AlgorithmIdentifier whose params will be used to configure the cipher.key
- is the Key instance that will be used by the cipher internally. This instance will be erased when the Cipher.erase()
is called.rbs
- is not used by this Cipher so any value is acceptable.oracle.security.crypto.core.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.oracle.security.crypto.core.InvalidKeyException
- is thrown if there is a problem with the Key instance the Cipher is being initialized with.oracle.security.crypto.core.CipherException
- is thrown if the op argument is null.public void setSession(CkiMgtSession session)
public void setAlgID(oracle.security.crypto.core.AlgorithmIdentifier algID) throws oracle.security.crypto.core.AlgorithmIdentifierException
oracle.security.crypto.core.AlgorithmIdentifierException
public oracle.security.crypto.core.AlgorithmIdentifier getAlgID()
getAlgID
in class oracle.security.crypto.core.Cipher
public java.lang.String algName()
algName
in class oracle.security.crypto.core.Coder
public int blockSize()
public int getBlockSize()
getBlockSize
in class oracle.security.crypto.core.Cipher
public void setKey(oracle.security.crypto.core.SymmetricKey key) throws oracle.security.crypto.core.InvalidKeyException
oracle.security.crypto.core.InvalidKeyException
- is always thrown here.public void setDecryptionKey(oracle.security.crypto.core.Key key) throws oracle.security.crypto.core.InvalidKeyException
oracle.security.crypto.core.InvalidKeyException
- is thrown if the the key is not valid for the Cipher instancepublic void setEncryptionKey(oracle.security.crypto.core.Key key) throws oracle.security.crypto.core.InvalidKeyException
oracle.security.crypto.core.InvalidKeyException
- is thrown if the the key is not valid for the Cipher instancepublic byte[] decrypt(byte[] bytes) throws oracle.security.crypto.core.CipherException
decrypt
in class oracle.security.crypto.core.Cipher
bytes
- the data block to decrypt.oracle.security.crypto.core.CipherException
- if the given block is not the right size or is incorrectly formatted, or uses a block type which is not supported. An exception is also thrown if the key cannot be found on the token.public byte[] decrypt(byte[] bytes, int inOff, int len, boolean unpad) throws oracle.security.crypto.core.CipherException
decrypt
in class oracle.security.crypto.core.Cipher
input
- Buffer in which data to be decrypted is stored.inOff
- Offset within buffer of the start of data.len
- The length of the dataunpad
- is an ignored parameter because encoding data is not optional in RSA Encryption.oracle.security.crypto.core.CipherException
- if cipher not initialized, data is not a multiple of the block size and no padding is specified, etc.public void decrypt(byte[] input, int inOff, int len, byte[] output, int outOff) throws oracle.security.crypto.core.CipherException
decrypt
in class oracle.security.crypto.core.Cipher
input
- array of bytes to decryptinOff
- offset of the start of the data to decryptlen
- the length of the data to decryptoutput
- array to place the decrypted bytesoutOff
- offset of the start of the decrypted bytesoracle.security.crypto.core.CipherException
- is thrown if there is a problem with the decryption process or if the cipher was initialized for encryption.public byte[] encrypt(byte[] bytes) throws oracle.security.crypto.core.CipherException
encrypt
in class oracle.security.crypto.core.Cipher
bytes
- the data to encrypt.oracle.security.crypto.core.CipherException
- if the given data is too long, or if the key cannot be found on the token.public byte[] encrypt(byte[] bytes, int inOff, int len, boolean pad) throws oracle.security.crypto.core.CipherException
encrypt
in class oracle.security.crypto.core.Cipher
input
- buffer in which data to be encrypted is stored.inOff
- offset within buffer of the start of the data.len
- the length of the data.pad
- is an ignored parameter because encoding data is not optional in RSA Encryption.oracle.security.crypto.core.CipherException
- if cipher not initialized, data is not a multiple of the block size and no padding is specified, etc.public void encrypt(byte[] input, int inOff, int len, byte[] output, int outOff) throws oracle.security.crypto.core.CipherException
encrypt
in class oracle.security.crypto.core.Cipher
input
- array of bytes to encryptinOff
- offset of the start of data to encryptlen
- the length of the data to encryptoutput
- array to place the encrypted bytesoutOff
- offset of the start of the encrypted bytesoracle.security.crypto.core.CipherException
- is thrown if there are problems with the encryption operation or if the Cipher was initialized for decryption.public void encryptOp(byte[] in, int inOff, byte[] out, int outOff) throws oracle.security.crypto.core.CipherException
oracle.security.crypto.core.CipherException
public void decryptOp(byte[] in, int inOff, byte[] out, int outOff) throws oracle.security.crypto.core.CipherException
oracle.security.crypto.core.CipherException
public void erase()
erase
in class oracle.security.crypto.core.Cipher
public void finalize()
finalize
in class oracle.security.crypto.core.Cipher