Package org.conscrypt
Class OpenSSLCipherRSA
java.lang.Object
javax.crypto.CipherSpi
org.conscrypt.OpenSSLCipherRSA
- Direct Known Subclasses:
OpenSSLCipherRSA.DirectRSA,OpenSSLCipherRSA.OAEP
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic final classstatic final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]Buffer for operationsprivate intCurrent offset in the buffer.(package private) booleanCurrent cipher mode: encrypting or decrypting.private booleanFlag that indicates an exception should be thrown when the input is too large during doFinal.(package private) OpenSSLKeyThe current OpenSSL key we're operating on.(package private) intCurrent padding mode(package private) booleanCurrent key type: private or public. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void(package private) abstract intdoCryptoOperation(byte[] tmpBuf, byte[] output) protected byte[]engineDoFinal(byte[] input, int inputOffset, int inputLen) protected intengineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) protected intprotected byte[]protected intengineGetKeySize(Key key) protected intengineGetOutputSize(int inputLen) protected AlgorithmParametersprotected voidengineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random) protected voidengineInit(int opmode, Key key, SecureRandom random) protected voidengineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) (package private) voidengineInitInternal(int opmode, Key key, AlgorithmParameterSpec spec) protected voidengineSetMode(String mode) protected voidengineSetPadding(String padding) protected KeyengineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) protected byte[]engineUpdate(byte[] input, int inputOffset, int inputLen) protected intengineUpdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) protected byte[]engineWrap(Key key) (package private) booleanReturnstrueif the cipher has been initialized.(package private) int(package private) intMethods inherited from class javax.crypto.CipherSpi
engineDoFinal, engineUpdate, engineUpdateAAD, engineUpdateAAD
-
Field Details
-
key
OpenSSLKey keyThe current OpenSSL key we're operating on. -
usingPrivateKey
boolean usingPrivateKeyCurrent key type: private or public. -
encrypting
boolean encryptingCurrent cipher mode: encrypting or decrypting. -
buffer
private byte[] bufferBuffer for operations -
bufferOffset
private int bufferOffsetCurrent offset in the buffer. -
inputTooLarge
private boolean inputTooLargeFlag that indicates an exception should be thrown when the input is too large during doFinal. -
padding
int paddingCurrent padding mode
-
-
Constructor Details
-
OpenSSLCipherRSA
OpenSSLCipherRSA(int padding)
-
-
Method Details
-
engineSetMode
- Specified by:
engineSetModein classCipherSpi- Throws:
NoSuchAlgorithmException
-
engineSetPadding
- Specified by:
engineSetPaddingin classCipherSpi- Throws:
NoSuchPaddingException
-
engineGetBlockSize
protected int engineGetBlockSize()- Specified by:
engineGetBlockSizein classCipherSpi
-
engineGetOutputSize
protected int engineGetOutputSize(int inputLen) - Specified by:
engineGetOutputSizein classCipherSpi
-
paddedBlockSizeBytes
int paddedBlockSizeBytes() -
keySizeBytes
int keySizeBytes() -
isInitialized
boolean isInitialized()Returnstrueif the cipher has been initialized. -
engineGetIV
protected byte[] engineGetIV()- Specified by:
engineGetIVin classCipherSpi
-
engineGetParameters
- Specified by:
engineGetParametersin classCipherSpi
-
doCryptoInit
void doCryptoInit(AlgorithmParameterSpec spec) throws InvalidAlgorithmParameterException, InvalidKeyException -
engineInitInternal
void engineInitInternal(int opmode, Key key, AlgorithmParameterSpec spec) throws InvalidKeyException, InvalidAlgorithmParameterException -
engineGetKeySize
- Overrides:
engineGetKeySizein classCipherSpi- Throws:
InvalidKeyException
-
engineInit
- Specified by:
engineInitin classCipherSpi- Throws:
InvalidKeyException
-
engineInit
protected void engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException - Specified by:
engineInitin classCipherSpi- Throws:
InvalidKeyExceptionInvalidAlgorithmParameterException
-
engineInit
protected void engineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException - Specified by:
engineInitin classCipherSpi- Throws:
InvalidKeyExceptionInvalidAlgorithmParameterException
-
engineUpdate
protected byte[] engineUpdate(byte[] input, int inputOffset, int inputLen) - Specified by:
engineUpdatein classCipherSpi
-
engineUpdate
protected int engineUpdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException - Specified by:
engineUpdatein classCipherSpi- Throws:
ShortBufferException
-
engineDoFinal
protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException - Specified by:
engineDoFinalin classCipherSpi- Throws:
IllegalBlockSizeExceptionBadPaddingException
-
doCryptoOperation
abstract int doCryptoOperation(byte[] tmpBuf, byte[] output) throws BadPaddingException, IllegalBlockSizeException -
engineDoFinal
protected int engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException - Specified by:
engineDoFinalin classCipherSpi- Throws:
ShortBufferExceptionIllegalBlockSizeExceptionBadPaddingException
-
engineWrap
- Overrides:
engineWrapin classCipherSpi- Throws:
IllegalBlockSizeExceptionInvalidKeyException
-
engineUnwrap
protected Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException - Overrides:
engineUnwrapin classCipherSpi- Throws:
InvalidKeyExceptionNoSuchAlgorithmException
-