Class CompositeKEMCipherSpi
java.lang.Object
javax.crypto.CipherSpi
org.bouncycastle.jcajce.provider.asymmetric.compositekem.CompositeKEMCipherSpi
- Direct Known Subclasses:
CompositeKEMCipherSpi.Base
KEM Cipher (KTS wrap/unwrap) for Composite ML-KEM (draft-ietf-lamps-pq-composite-kem), enabling
composite recipients in CMS via JceKEMRecipientInfoGenerator / JceKEMEnvelopedRecipient. The
composite OID is taken from the key, so a single generic Base SPI covers all parameter sets.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]engineDoFinal(byte[] bytes, int i, int i1) protected intengineDoFinal(byte[] bytes, int i, int i1, byte[] bytes1, int i2) protected intprotected byte[]protected intengineGetKeySize(Key key) protected intengineGetOutputSize(int i) protected AlgorithmParametersprotected voidengineInit(int opmode, Key key, AlgorithmParameters algorithmParameters, SecureRandom random) protected voidengineInit(int opmode, Key key, SecureRandom random) protected voidengineInit(int opmode, Key key, AlgorithmParameterSpec paramSpec, SecureRandom random) protected voidengineSetMode(String mode) protected voidengineSetPadding(String padding) protected KeyengineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) protected byte[]engineUpdate(byte[] bytes, int i, int i1) protected intengineUpdate(byte[] bytes, int i, int i1, byte[] bytes1, int i2) protected byte[]engineWrap(Key key) Methods inherited from class CipherSpi
engineDoFinal, engineUpdate, engineUpdateAAD, engineUpdateAAD
-
Constructor Details
-
CompositeKEMCipherSpi
-
-
Method Details
-
engineSetMode
- Specified by:
engineSetModein classCipherSpi- Throws:
NoSuchAlgorithmException
-
engineSetPadding
- Specified by:
engineSetPaddingin classCipherSpi- Throws:
NoSuchPaddingException
-
engineGetKeySize
- Overrides:
engineGetKeySizein classCipherSpi
-
engineGetBlockSize
protected int engineGetBlockSize()- Specified by:
engineGetBlockSizein classCipherSpi
-
engineGetOutputSize
protected int engineGetOutputSize(int i) - Specified by:
engineGetOutputSizein classCipherSpi
-
engineGetIV
protected byte[] engineGetIV()- Specified by:
engineGetIVin classCipherSpi
-
engineGetParameters
- Specified by:
engineGetParametersin classCipherSpi
-
engineInit
- Specified by:
engineInitin classCipherSpi- Throws:
InvalidKeyException
-
engineInit
protected void engineInit(int opmode, Key key, AlgorithmParameterSpec paramSpec, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException - Specified by:
engineInitin classCipherSpi- Throws:
InvalidKeyExceptionInvalidAlgorithmParameterException
-
engineInit
protected void engineInit(int opmode, Key key, AlgorithmParameters algorithmParameters, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException - Specified by:
engineInitin classCipherSpi- Throws:
InvalidKeyExceptionInvalidAlgorithmParameterException
-
engineUpdate
protected byte[] engineUpdate(byte[] bytes, int i, int i1) - Specified by:
engineUpdatein classCipherSpi
-
engineUpdate
protected int engineUpdate(byte[] bytes, int i, int i1, byte[] bytes1, int i2) throws ShortBufferException - Specified by:
engineUpdatein classCipherSpi- Throws:
ShortBufferException
-
engineDoFinal
protected byte[] engineDoFinal(byte[] bytes, int i, int i1) throws IllegalBlockSizeException, BadPaddingException - Specified by:
engineDoFinalin classCipherSpi- Throws:
IllegalBlockSizeExceptionBadPaddingException
-
engineDoFinal
protected int engineDoFinal(byte[] bytes, int i, int i1, byte[] bytes1, int i2) 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
-