Class JSSCipherSpi
java.lang.Object
javax.crypto.CipherSpi
org.mozilla.jss.provider.javax.crypto.JSSCipherSpi
- Direct Known Subclasses:
JSSCipherSpi.AES
,JSSCipherSpi.DES
,JSSCipherSpi.DESede
,JSSCipherSpi.RC2
,JSSCipherSpi.RC4
,JSSCipherSpi.RSA
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
private static class
static class
static class
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private String
private String
private int
private Cipher
private int
private static final JSSCipherSpi.NoAlgParams
private AlgorithmParameterSpec
(package private) CryptoToken
private KeyWrapper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
engineDoFinal
(byte[] input, int inputOffset, int inputLen) int
engineDoFinal
(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) int
byte[]
int
engineGetKeySize
(Key key) int
engineGetOutputSize
(int inputLen) void
engineInit
(int opmode, Key key, AlgorithmParameters givenParams, SecureRandom random) void
engineInit
(int opmode, Key key, SecureRandom random) void
engineInit
(int opmode, Key key, AlgorithmParameterSpec givenParams, SecureRandom random) void
engineSetMode
(String mode) void
engineSetPadding
(String padding) engineUnwrap
(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) private Key
engineUnwrapPrivate
(byte[] wrappedKey, String wrappedKeyAlg) private Key
engineUnwrapSecret
(byte[] wrappedKey, String wrappedKeyAlg) byte[]
engineUpdate
(byte[] input, int inputOffset, int inputLen) int
engineUpdate
(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) byte[]
engineWrap
(Key key) private AlgorithmParameterSpec
generateAlgParams
(Algorithm alg, int blockSize) private static SecretKey
Methods inherited from class javax.crypto.CipherSpi
engineDoFinal, engineUpdate, engineUpdateAAD, engineUpdateAAD
-
Field Details
-
algFamily
-
algMode
-
algPadding
-
token
CryptoToken token -
cipher
-
wrapper
-
params
-
blockSize
private int blockSize -
keyStrength
private int keyStrength -
noAlgParams
-
-
Constructor Details
-
JSSCipherSpi
-
-
Method Details
-
engineSetMode
- Specified by:
engineSetMode
in classCipherSpi
-
engineSetPadding
- Specified by:
engineSetPadding
in classCipherSpi
-
importKey
- Throws:
InvalidKeyException
-
engineInit
public void engineInit(int opmode, Key key, AlgorithmParameterSpec givenParams, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException - Specified by:
engineInit
in classCipherSpi
- Throws:
InvalidKeyException
InvalidAlgorithmParameterException
-
engineInit
public void engineInit(int opmode, Key key, AlgorithmParameters givenParams, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException - Specified by:
engineInit
in classCipherSpi
- Throws:
InvalidKeyException
InvalidAlgorithmParameterException
-
engineInit
- Specified by:
engineInit
in classCipherSpi
- Throws:
InvalidKeyException
-
generateAlgParams
-
engineGetBlockSize
public int engineGetBlockSize()- Specified by:
engineGetBlockSize
in classCipherSpi
-
engineGetIV
public byte[] engineGetIV()- Specified by:
engineGetIV
in classCipherSpi
-
engineGetParameters
- Specified by:
engineGetParameters
in classCipherSpi
-
engineGetOutputSize
public int engineGetOutputSize(int inputLen) - Specified by:
engineGetOutputSize
in classCipherSpi
-
engineUpdate
public byte[] engineUpdate(byte[] input, int inputOffset, int inputLen) - Specified by:
engineUpdate
in classCipherSpi
-
engineUpdate
public int engineUpdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException - Specified by:
engineUpdate
in classCipherSpi
- Throws:
ShortBufferException
-
engineDoFinal
public byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException - Specified by:
engineDoFinal
in classCipherSpi
- Throws:
IllegalBlockSizeException
BadPaddingException
-
engineDoFinal
public int engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException - Specified by:
engineDoFinal
in classCipherSpi
- Throws:
ShortBufferException
IllegalBlockSizeException
BadPaddingException
-
engineWrap
- Overrides:
engineWrap
in classCipherSpi
- Throws:
IllegalBlockSizeException
InvalidKeyException
-
engineUnwrap
public Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException - Overrides:
engineUnwrap
in classCipherSpi
- Throws:
InvalidKeyException
NoSuchAlgorithmException
-
engineUnwrapSecret
private Key engineUnwrapSecret(byte[] wrappedKey, String wrappedKeyAlg) throws NoSuchAlgorithmException - Throws:
NoSuchAlgorithmException
-
engineUnwrapPrivate
private Key engineUnwrapPrivate(byte[] wrappedKey, String wrappedKeyAlg) throws NoSuchAlgorithmException - Throws:
NoSuchAlgorithmException
-
engineGetKeySize
- Overrides:
engineGetKeySize
in classCipherSpi
- Throws:
InvalidKeyException
-