Note
RSA keys should be at least 512 bits long
| Modifier and Type | Field and Description |
|---|---|
| private static final byte[] | |
| private byte[] | |
| private int | |
| private boolean | |
| private int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private String | |
| private int | |
| private static final String | |
| private static final String | |
| private static final String | |
| private RSAPadding | |
| private String | |
| private RSAPrivateKey | |
| private RSAPublicKey | |
| private SecureRandom | |
| private AlgorithmParameterSpec |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private byte[] | |
| private byte[] | |
| 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 | 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 paddingName)
Implements abstract javax. Sets the padding mechanism of this cipher. |
| protected Key | engineUnwrap(byte[] wrappedKey, String algorithm, int type)
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 byte[] | |
| private void | |
| private void |
| B0 | back to summary |
|---|---|
| private static final byte[] B0 | |
| buffer | back to summary |
|---|---|
| private byte[] buffer | |
| bufOfs | back to summary |
|---|---|
| private int bufOfs | |
| forTlsPremasterSecret | back to summary |
|---|---|
| private boolean forTlsPremasterSecret | |
| mode | back to summary |
|---|---|
| private int mode | |
| MODE_DECRYPT | back to summary |
|---|---|
| private static final int MODE_DECRYPT | |
| MODE_ENCRYPT | back to summary |
|---|---|
| private static final int MODE_ENCRYPT | |
| MODE_SIGN | back to summary |
|---|---|
| private static final int MODE_SIGN | |
| MODE_VERIFY | back to summary |
|---|---|
| private static final int MODE_VERIFY | |
| oaepHashAlgorithm | back to summary |
|---|---|
| private String oaepHashAlgorithm | |
| outputSize | back to summary |
|---|---|
| private int outputSize | |
| PAD_NONE | back to summary |
|---|---|
| private static final String PAD_NONE | |
| PAD_OAEP_MGF1 | back to summary |
|---|---|
| private static final String PAD_OAEP_MGF1 | |
| PAD_PKCS1 | back to summary |
|---|---|
| private static final String PAD_PKCS1 | |
| padding | back to summary |
|---|---|
| private RSAPadding padding | |
| paddingType | back to summary |
|---|---|
| private String paddingType | |
| privateKey | back to summary |
|---|---|
| private RSAPrivateKey privateKey | |
| publicKey | back to summary |
|---|---|
| private RSAPublicKey publicKey | |
| random | back to summary |
|---|---|
| private SecureRandom random | |
| spec | back to summary |
|---|---|
| private AlgorithmParameterSpec spec | |
| RSACipher | back to summary |
|---|---|
| public RSACipher() | |
| doFinal | back to summary |
|---|---|
| private byte[] doFinal() throws BadPaddingException, IllegalBlockSizeException | |
| doFinalForTls | back to summary |
|---|---|
| private byte[] doFinalForTls(int clientVersion, int serverVersion) throws BadPaddingException, IllegalBlockSizeException | |
| engineDoFinal | back to summary |
|---|---|
| protected byte[] engineDoFinal(byte[] in, int inOfs, int inLen) throws BadPaddingException, IllegalBlockSizeException 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, BadPaddingException, IllegalBlockSizeException 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
| |
| 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 paddingName) 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 algorithm, int type) 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) Implements abstract javax. Doc from javax. Continues a multiple-part encryption or decryption operation
(depending on how this The first If the | |
| engineWrap | back to summary |
|---|---|
| protected byte[] engineWrap(Key key) throws InvalidKeyException, IllegalBlockSizeException 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
| |
| init | back to summary |
|---|---|
private void init(int opmode, Key key, SecureRandom random, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException
| |
| update | back to summary |
|---|---|
| private void update(byte[] in, int inOfs, int inLen) | |