Package org.mozilla.jss.pkcs11
Class PK11Cipher
- java.lang.Object
-
- org.mozilla.jss.crypto.Cipher
-
- org.mozilla.jss.pkcs11.PK11Cipher
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public final class PK11Cipher extends Cipher implements java.lang.AutoCloseable
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()byte[]doFinal()Deprecated.isPadded() in EncryptionAlgorithm has been deprecatedbyte[]doFinal(byte[] bytes)Deprecated.isPadded() in EncryptionAlgorithm has been deprecatedbyte[]doFinal(byte[] bytes, int offset, int length)Completes an cipher operation.voidfinalize()voidinitDecrypt(SymmetricKey key)Initializes a decryption context with a symmetric key.voidinitDecrypt(SymmetricKey key, java.security.spec.AlgorithmParameterSpec parameters)Deprecated.isPadded() in EncryptionAlgorithm has been deprecatedvoidinitEncrypt(SymmetricKey key)Initializes a encryption context with a symmetric key.voidinitEncrypt(SymmetricKey key, java.security.spec.AlgorithmParameterSpec parameters)Deprecated.isPadded() in EncryptionAlgorithm has been deprecatedbyte[]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.
-
-
-
Method Detail
-
initEncrypt
public void initEncrypt(SymmetricKey key) throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException, TokenException
Description copied from class:CipherInitializes a encryption context with a symmetric key.- Specified by:
initEncryptin classCipher- Throws:
java.security.InvalidKeyExceptionjava.security.InvalidAlgorithmParameterExceptionTokenException
-
initDecrypt
public void initDecrypt(SymmetricKey key) throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException, TokenException
Description copied from class:CipherInitializes a decryption context with a symmetric key.- Specified by:
initDecryptin classCipher- Throws:
java.security.InvalidKeyExceptionjava.security.InvalidAlgorithmParameterExceptionTokenException
-
initEncrypt
@Deprecated public void initEncrypt(SymmetricKey key, java.security.spec.AlgorithmParameterSpec parameters) throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException, TokenException
Deprecated.isPadded() in EncryptionAlgorithm has been deprecatedDescription copied from class:CipherInitializes an encryption context with a symmetric key and algorithm parameters.- Specified by:
initEncryptin classCipher- Throws:
java.security.InvalidKeyExceptionjava.security.InvalidAlgorithmParameterExceptionTokenException
-
initDecrypt
@Deprecated public void initDecrypt(SymmetricKey key, java.security.spec.AlgorithmParameterSpec parameters) throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException, TokenException
Deprecated.isPadded() in EncryptionAlgorithm has been deprecatedDescription copied from class:CipherInitializes a decryption context with a symmetric key and algorithm parameters.- Specified by:
initDecryptin classCipher- Throws:
java.security.InvalidKeyExceptionjava.security.InvalidAlgorithmParameterExceptionTokenException
-
update
public byte[] update(byte[] bytes) throws java.lang.IllegalStateException, TokenExceptionDescription copied from class:CipherUpdates the encryption context with additional input.- Specified by:
updatein classCipher- Parameters:
bytes- Bytes of plaintext (if encrypting) or ciphertext (if decrypting).- Returns:
- Bytes of ciphertext (if encrypting) or plaintext (if decrypting).
- Throws:
java.lang.IllegalStateExceptionTokenException
-
update
public byte[] update(byte[] bytes, int offset, int length) throws java.lang.IllegalStateException, TokenExceptionDescription copied from class:CipherUpdates the encryption context with additional plaintext.- Specified by:
updatein classCipher- Parameters:
bytes- Bytes of plaintext (if encrypting) or ciphertext (if decrypting).offset- The index inbytesat which to begin reading.length- The number of bytes frombytesto read.- Returns:
- Bytes of ciphertext (if encrypting) or plaintext (if decrypting).
- Throws:
java.lang.IllegalStateExceptionTokenException
-
doFinal
@Deprecated public byte[] doFinal(byte[] bytes) throws java.lang.IllegalStateException, IllegalBlockSizeException, javax.crypto.BadPaddingException, TokenExceptionDeprecated.isPadded() in EncryptionAlgorithm has been deprecatedDescription copied from class:CipherCompletes an cipher operation. This can be called directly after the context is initialized, orupdatemay be called any number of times before callingfinal.- Specified by:
doFinalin classCipher- Parameters:
bytes- Bytes of plaintext (if encrypting) or ciphertext (if decrypting).- Returns:
- The last of the output.
- Throws:
java.lang.IllegalStateExceptionIllegalBlockSizeExceptionjavax.crypto.BadPaddingExceptionTokenException
-
doFinal
public byte[] doFinal(byte[] bytes, int offset, int length) throws java.lang.IllegalStateException, IllegalBlockSizeException, javax.crypto.BadPaddingException, TokenExceptionDescription copied from class:CipherCompletes an cipher operation.- Specified by:
doFinalin classCipher- Parameters:
bytes- Bytes of plaintext (if encrypting) or ciphertext (if decrypting).offset- The index inbytesat which to begin reading.length- The number of bytes frombytesto read.- Returns:
- The last of the output.
- Throws:
java.lang.IllegalStateExceptionIllegalBlockSizeExceptionjavax.crypto.BadPaddingExceptionTokenException
-
doFinal
@Deprecated public byte[] doFinal() throws java.lang.IllegalStateException, IllegalBlockSizeException, javax.crypto.BadPaddingException, TokenExceptionDeprecated.isPadded() in EncryptionAlgorithm has been deprecatedDescription copied from class:CipherCompletes an cipher operation.- Specified by:
doFinalin classCipher- Returns:
- The last of the output.
- Throws:
java.lang.IllegalStateExceptionIllegalBlockSizeExceptionjavax.crypto.BadPaddingExceptionTokenException
-
finalize
public void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
close
public void close() throws java.lang.Exception- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
-