| Modifier and Type | Class and Description |
|---|---|
| private static enum | |
| private static enum | |
| private static interface | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final P11Cipher. | |
| private final int | |
| private int | |
| private boolean | |
| private int | |
| private boolean | |
| private byte[] | |
| private final String | |
| private final long | |
| private static final JavaNioAccess | |
| private P11Key | |
| private byte[] | |
| private int | |
| private P11Cipher. | |
| private P11Cipher. | |
| private boolean | |
| private Session | |
| private final Token |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private final void | |
| private final void | |
| private void | |
| private void | convertCTSVariant(ByteBuffer ciphertextBuf, byte[] ciphertextArr, int ciphertextEnd)
The ciphertext ordering for the three variants can be depicted as follows, where 'p' is the penultimate block (which may be partial or full), and 'f' the full final block: 'p' is a partial block 'p' is a full block ------------------------ --------------------- CS1 (NIST) | .... |
| private int | |
| protected byte[] | engineDoFinal(byte[] in, int inOfs, int inLen)
Implements abstract javax. Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| protected int | engineDoFinal(byte[] in, int inOfs, int inLen, byte[] out, int outOfs)
Implements abstract javax. Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| protected int | engineDoFinal(ByteBuffer inBuffer, ByteBuffer outBuffer)
Overrides javax. Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| protected int | engineGetBlockSize()
Implements abstract javax. Returns the block size (in bytes). |
| protected byte[] | engineGetIV()
Implements abstract javax. Returns the initialization vector (IV) in a new buffer. |
| protected int | engineGetKeySize(Key key)
Overrides javax. Returns the key size of the given key object in bits. |
| protected int | engineGetOutputSize(int inputLen)
Implements abstract javax. Returns the length in bytes that an output buffer would
need to be in order to hold the result of the next |
| protected AlgorithmParameters | engineGetParameters()
Implements abstract javax. Returns the parameters used with this cipher. |
| protected void | engineInit(int opmode, Key key, SecureRandom random)
Implements abstract javax. Initializes this |
| protected void | engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random)
Implements abstract javax. Initializes this |
| protected void | engineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random)
Implements abstract javax. Initializes this |
| protected void | engineSetMode(String mode)
Implements abstract javax. Sets the mode of this cipher. |
| protected void | engineSetPadding(String padding)
Implements abstract javax. Sets the padding mechanism of this cipher. |
| protected Key | engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType)
Overrides javax. Unwrap a previously wrapped key. |
| protected byte[] | engineUpdate(byte[] in, int inOfs, int inLen)
Implements abstract javax. Continues a multiple-part encryption or decryption operation
(depending on how this |
| protected int | engineUpdate(byte[] in, int inOfs, int inLen, byte[] out, int outOfs)
Implements abstract javax. Continues a multiple-part encryption or decryption operation
(depending on how this |
| protected int | engineUpdate(ByteBuffer inBuffer, ByteBuffer outBuffer)
Overrides javax. Continues a multiple-part encryption or decryption operation
(depending on how this |
| protected byte[] | |
| private void | |
| private int | |
| private int | |
| private void | |
| private int | |
| private int | |
| private void | |
| private int | |
| private int | |
| private void | |
| private P11Cipher. | |
| private void | |
| private static void | |
| private int |
| algorithm | back to summary |
|---|---|
| private final String algorithm | |
| blockMode | back to summary |
|---|---|
| private final P11Cipher. | |
| blockSize | back to summary |
|---|---|
| private final int blockSize | |
| bytesBuffered | back to summary |
|---|---|
| private int bytesBuffered | |
| encrypt | back to summary |
|---|---|
| private boolean encrypt | |
| fixedKeySize | back to summary |
|---|---|
| private int fixedKeySize | |
| initialized | back to summary |
|---|---|
| private boolean initialized | |
| iv | back to summary |
|---|---|
| private byte[] iv | |
| keyAlgorithm | back to summary |
|---|---|
| private final String keyAlgorithm | |
| mechanism | back to summary |
|---|---|
| private final long mechanism | |
| NIO_ACCESS | back to summary |
|---|---|
| private static final JavaNioAccess NIO_ACCESS | |
| p11Key | back to summary |
|---|---|
| private P11Key p11Key | |
| padBuffer | back to summary |
|---|---|
| private byte[] padBuffer | |
| padBufferLen | back to summary |
|---|---|
| private int padBufferLen | |
| paddingObj | back to summary |
|---|---|
| private P11Cipher. | |
| paddingType | back to summary |
|---|---|
| private P11Cipher. | |
| reqBlockUpdates | back to summary |
|---|---|
| private boolean reqBlockUpdates | |
| session | back to summary |
|---|---|
| private Session session | |
| token | back to summary |
|---|---|
| private final Token token | |
| P11Cipher | back to summary |
|---|---|
| pack-priv P11Cipher(Token token, String algorithm, long mechanism) throws PKCS11Exception, NoSuchAlgorithmException | |
| bufferInputBytes | back to summary |
|---|---|
| private final void bufferInputBytes(byte[] in, int inOfs, int len) | |
| bufferInputBytes | back to summary |
|---|---|
| private final void bufferInputBytes(ByteBuffer inBuffer, int len) | |
| cancelOperation | back to summary |
|---|---|
| private void cancelOperation() | |
| convertCTSVariant | back to summary |
|---|---|
| private void convertCTSVariant(ByteBuffer ciphertextBuf, byte[] ciphertextArr, int ciphertextEnd) The ciphertext ordering for the three variants can be depicted as follows, where 'p' is the penultimate block (which may be partial or full), and 'f' the full final block: 'p' is a partial block 'p' is a full block ------------------------ --------------------- CS1 (NIST) | .... pp ffff | .... pppp ffff CS2 (Schneier) | .... ffff pp | .... pppp ffff CS3 (Kerberos) | .... ffff pp | .... ffff pppp After encryption, we get the ciphertext from the token formatted as specified in the SunPKCS11 'cipherTextStealingVariant' configuration property. Conversely, before decryption, the ciphertext has to be passed to the token according to the previous formatting. This method converts the ciphertext between the format used by the token and the one used by SunJCE's "AES/CTS/NoPadding" implementation (CS3 as described by RFC 2040, section 8). | |
| doFinalLength | back to summary |
|---|---|
| private int doFinalLength(int inLen) | |
| engineDoFinal | back to summary |
|---|---|
| protected byte[] engineDoFinal(byte[] in, int inOfs, int inLen) throws IllegalBlockSizeException, BadPaddingException Implements abstract javax. Doc from javax. Encrypts or decrypts data in a single-part operation,
or finishes a multiple-part operation.
The data is encrypted or decrypted, depending on how this
The first Upon finishing, this method resets this Note if any exception is thrown, this
| |
| engineDoFinal | back to summary |
|---|---|
| protected int engineDoFinal(byte[] in, int inOfs, int inLen, byte[] out, int outOfs) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException Implements abstract javax. Doc from javax. Encrypts or decrypts data in a single-part operation,
or finishes a multiple-part operation.
The data is encrypted or decrypted, depending on how this
The first If the Upon finishing, this method resets this Note if any exception is thrown, this
| |
| engineDoFinal | back to summary |
|---|---|
| protected int engineDoFinal(ByteBuffer inBuffer, ByteBuffer outBuffer) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException Overrides javax. Doc from javax. Encrypts or decrypts data in a single-part operation,
or finishes a multiple-part operation.
The data is encrypted or decrypted, depending on how this
All If Upon finishing, this method resets this Note if any exception is thrown, this Subclasses should consider overriding this method if they can process ByteBuffers more efficiently than byte arrays.
| |
| engineGetBlockSize | back to summary |
|---|---|
| protected int engineGetBlockSize() Implements abstract javax. Doc from javax. Returns the block size (in bytes). | |
| engineGetIV | back to summary |
|---|---|
| protected byte[] engineGetIV() Implements abstract javax. Doc from javax. Returns the initialization vector (IV) in a new buffer. This is useful in the context of password-based encryption or decryption, where the IV is derived from a user-provided passphrase. | |
| engineGetKeySize | back to summary |
|---|---|
| protected int engineGetKeySize(Key key) throws InvalidKeyException Overrides javax. Doc from javax. Returns the key size of the given key object in bits. This concrete method has been added to this previously-defined
abstract class. It throws an
| |
| engineGetOutputSize | back to summary |
|---|---|
| protected int engineGetOutputSize(int inputLen) Implements abstract javax. Doc from javax. Returns the length in bytes that an output buffer would
need to be in order to hold the result of the next This call takes into account any unprocessed (buffered) data from a
previous The actual output length of the next | |
| engineGetParameters | back to summary |
|---|---|
| protected AlgorithmParameters engineGetParameters() Implements abstract javax. Doc from javax. Returns the parameters used with this cipher. The returned parameters may be the same that were used to initialize
this cipher, or may contain additional default or random parameter
values used by the underlying cipher implementation. If the required
parameters were not supplied and can be generated by the cipher, the
generated parameters are returned. Otherwise, | |
| engineInit | back to summary |
|---|---|
| protected void engineInit(int opmode, Key key, SecureRandom random) throws InvalidKeyException Implements abstract javax. Doc from javax. Initializes this The If this cipher requires any algorithm parameters that cannot be
derived from the given If this cipher requires algorithm parameters that cannot be derived from the input parameters, and there are no reasonable provider-specific default values, initialization will necessarily fail. If this cipher (including its feedback or padding scheme)
requires any random bytes (e.g., for parameter generation), it will get
them from Note that when a
| |
| engineInit | back to summary |
|---|---|
| protected void engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException Implements abstract javax. Doc from javax. Initializes this The If this cipher requires any algorithm parameters and
If this cipher requires algorithm parameters that cannot be derived from the input parameters, and there are no reasonable provider-specific default values, initialization will necessarily fail. If this cipher (including its feedback or padding scheme)
requires any random bytes (e.g., for parameter generation), it will get
them from Note that when a
| |
| engineInit | back to summary |
|---|---|
| protected void engineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException Implements abstract javax. Doc from javax. Initializes this The If this cipher requires any algorithm parameters and
If this cipher requires algorithm parameters that cannot be derived from the input parameters, and there are no reasonable provider-specific default values, initialization will necessarily fail. If this cipher (including its feedback or padding scheme)
requires any random bytes (e.g., for parameter generation), it will get
them from Note that when a
| |
| engineSetMode | back to summary |
|---|---|
| protected void engineSetMode(String mode) throws NoSuchAlgorithmException Implements abstract javax. Doc from javax. Sets the mode of this cipher.
| |
| engineSetPadding | back to summary |
|---|---|
| protected void engineSetPadding(String padding) throws NoSuchPaddingException Implements abstract javax. Doc from javax. Sets the padding mechanism of this cipher.
| |
| engineUnwrap | back to summary |
|---|---|
| protected Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException Overrides javax. Doc from javax. Unwrap a previously wrapped key. This concrete method has been added to this previously-defined
abstract class. (For backwards compatibility, it cannot be abstract.)
It may be overridden by a provider to unwrap a previously wrapped key.
Such an override is expected to throw an
| |
| engineUpdate | back to summary |
|---|---|
| protected byte[] engineUpdate(byte[] in, int inOfs, int inLen) Implements abstract javax. Doc from javax. Continues a multiple-part encryption or decryption operation
(depending on how this The first | |
| engineUpdate | back to summary |
|---|---|
| protected int engineUpdate(byte[] in, int inOfs, int inLen, byte[] out, int outOfs) throws ShortBufferException Implements abstract javax. Doc from javax. Continues a multiple-part encryption or decryption operation
(depending on how this The first If the
| |
| engineUpdate | back to summary |
|---|---|
| protected int engineUpdate(ByteBuffer inBuffer, ByteBuffer outBuffer) throws ShortBufferException Overrides javax. Doc from javax. Continues a multiple-part encryption or decryption operation
(depending on how this All If Subclasses should consider overriding this method if they can process ByteBuffers more efficiently than byte arrays.
| |
| engineWrap | back to summary |
|---|---|
| protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException Overrides javax. Doc from javax. Wrap a key. This concrete method has been added to this previously-defined
abstract class. (For backwards compatibility, it cannot be abstract.)
It may be overridden by a provider to wrap a key.
Such an override is expected to throw an
| |
| ensureInitialized | back to summary |
|---|---|
| private void ensureInitialized() throws PKCS11Exception | |
| getBytesToCompleteBlock | back to summary |
|---|---|
| private int getBytesToCompleteBlock(int availableBytes) | |
| getCTSMustBeBuffered | back to summary |
|---|---|
| private int getCTSMustBeBuffered(int availableBytes) | |
| handleException | back to summary |
|---|---|
| private void handleException(PKCS11Exception e) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException | |
| implDoFinal | back to summary |
|---|---|
| private int implDoFinal(byte[] out, int outOfs, int outLen) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException | |
| implDoFinal | back to summary |
|---|---|
| private int implDoFinal(ByteBuffer outBuffer) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException | |
| implInit | back to summary |
|---|---|
| private void implInit(int opmode, Key key, byte[] iv, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException | |
| implUpdate | back to summary |
|---|---|
| private int implUpdate(byte[] in, int inOfs, int inLen, byte[] out, int outOfs, int outLen) throws ShortBufferException | |
| implUpdate | back to summary |
|---|---|
| private int implUpdate(ByteBuffer inBuffer, ByteBuffer outBuffer) throws ShortBufferException | |
| initialize | back to summary |
|---|---|
| private void initialize() throws PKCS11Exception | |
| parseMode | back to summary |
|---|---|
| private P11Cipher. | |
| reset | back to summary |
|---|---|
| private void reset(boolean doCancel) | |
| swapLastTwoBlocks | back to summary |
|---|---|
| private static void swapLastTwoBlocks(ByteBuffer ciphertextBuf, int ciphertextEnd, int prevBlockLen, int lastBlockLen) | |
| updateLength | back to summary |
|---|---|
| private int updateLength(int inLen) | |
| Modifier and Type | Field and Description |
|---|---|
| public static final P11Cipher. | |
| public static final P11Cipher. | |
| public static final P11Cipher. | |
| public static final P11Cipher. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static P11Cipher. | |
| public static P11Cipher. |
| CBC | back to summary |
|---|---|
| public static final P11Cipher. | |
| CTR | back to summary |
|---|---|
| public static final P11Cipher. | |
| CTS | back to summary |
|---|---|
| public static final P11Cipher. | |
| ECB | back to summary |
|---|---|
| public static final P11Cipher. | |
| Mode | back to summary |
|---|---|
| private Mode() | |
| valueOf | back to summary |
|---|---|
| public static P11Cipher. | |
| values | back to summary |
|---|---|
| public static P11Cipher. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final P11Cipher. | |
| public static final P11Cipher. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static P11Cipher. | |
| public static P11Cipher. |
| NONE | back to summary |
|---|---|
| public static final P11Cipher. | |
| PKCS5 | back to summary |
|---|---|
| public static final P11Cipher. | |
| Pad | back to summary |
|---|---|
| private Pad() | |
| valueOf | back to summary |
|---|---|
| public static P11Cipher. | |
| values | back to summary |
|---|---|
| public static P11Cipher. | |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public int |
| setPaddingBytes | back to summary |
|---|---|
| public int setPaddingBytes(byte[] paddingBuffer, int startOff, int padLen) | |
| unpad | back to summary |
|---|---|
| public int unpad(byte[] paddedData, int len) throws BadPaddingException, IllegalBlockSizeException | |
| Modifier and Type | Field and Description |
|---|---|
| private final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | setPaddingBytes(byte[] paddingBuffer, int startOff, int padLen)
Implements sun.
|
| public int |
| blockSize | back to summary |
|---|---|
| private final int blockSize | |
| PKCS5Padding | back to summary |
|---|---|
| pack-priv PKCS5Padding(int blockSize) throws NoSuchPaddingException | |
| setPaddingBytes | back to summary |
|---|---|
| public int setPaddingBytes(byte[] paddingBuffer, int startOff, int padLen) Implements sun. | |
| unpad | back to summary |
|---|---|
| public int unpad(byte[] paddedData, int len) throws BadPaddingException, IllegalBlockSizeException Implements sun. | |