public final class PK11Cipher extends Cipher implements java.lang.AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close() |
byte[] |
doFinal()
Deprecated.
isPadded() in EncryptionAlgorithm has been deprecated
|
byte[] |
doFinal(byte[] bytes)
Deprecated.
isPadded() in EncryptionAlgorithm has been deprecated
|
byte[] |
doFinal(byte[] bytes,
int offset,
int length)
Completes an cipher operation.
|
void |
finalize() |
void |
initDecrypt(SymmetricKey key)
Initializes a decryption context with a symmetric key.
|
void |
initDecrypt(SymmetricKey key,
java.security.spec.AlgorithmParameterSpec parameters)
Deprecated.
isPadded() in EncryptionAlgorithm has been deprecated
|
void |
initEncrypt(SymmetricKey key)
Initializes a encryption context with a symmetric key.
|
void |
initEncrypt(SymmetricKey key,
java.security.spec.AlgorithmParameterSpec parameters)
Deprecated.
isPadded() in EncryptionAlgorithm has been deprecated
|
byte[] |
update(byte[] bytes)
Updates the encryption context with additional input.
|
byte[] |
update(byte[] bytes,
int offset,
int length)
Updates the encryption context with additional plaintext.
|
public void initEncrypt(SymmetricKey key) throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException, TokenException
Cipher
initEncrypt
in class Cipher
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException
TokenException
public void initDecrypt(SymmetricKey key) throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException, TokenException
Cipher
initDecrypt
in class Cipher
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException
TokenException
@Deprecated public void initEncrypt(SymmetricKey key, java.security.spec.AlgorithmParameterSpec parameters) throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException, TokenException
Cipher
initEncrypt
in class Cipher
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException
TokenException
@Deprecated public void initDecrypt(SymmetricKey key, java.security.spec.AlgorithmParameterSpec parameters) throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException, TokenException
Cipher
initDecrypt
in class Cipher
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException
TokenException
public byte[] update(byte[] bytes) throws java.lang.IllegalStateException, TokenException
Cipher
update
in class Cipher
bytes
- Bytes of plaintext (if encrypting) or ciphertext (if
decrypting).java.lang.IllegalStateException
TokenException
public byte[] update(byte[] bytes, int offset, int length) throws java.lang.IllegalStateException, TokenException
Cipher
update
in class Cipher
bytes
- Bytes of plaintext (if encrypting) or ciphertext (if
decrypting).offset
- The index in bytes
at which to begin reading.length
- The number of bytes from bytes
to read.java.lang.IllegalStateException
TokenException
@Deprecated public byte[] doFinal(byte[] bytes) throws java.lang.IllegalStateException, IllegalBlockSizeException, javax.crypto.BadPaddingException, TokenException
Cipher
update
may be called
any number of times before calling final
.doFinal
in class Cipher
bytes
- Bytes of plaintext (if encrypting) or ciphertext (if
decrypting).java.lang.IllegalStateException
IllegalBlockSizeException
javax.crypto.BadPaddingException
TokenException
public byte[] doFinal(byte[] bytes, int offset, int length) throws java.lang.IllegalStateException, IllegalBlockSizeException, javax.crypto.BadPaddingException, TokenException
Cipher
doFinal
in class Cipher
bytes
- Bytes of plaintext (if encrypting) or ciphertext (if
decrypting).offset
- The index in bytes
at which to begin reading.length
- The number of bytes from bytes
to read.java.lang.IllegalStateException
IllegalBlockSizeException
javax.crypto.BadPaddingException
TokenException
@Deprecated public byte[] doFinal() throws java.lang.IllegalStateException, IllegalBlockSizeException, javax.crypto.BadPaddingException, TokenException
Cipher
doFinal
in class Cipher
java.lang.IllegalStateException
IllegalBlockSizeException
javax.crypto.BadPaddingException
TokenException
public void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void close() throws java.lang.Exception
close
in interface java.lang.AutoCloseable
java.lang.Exception