KEM implementations that can be
configured with a named parameter set. See NamedKeyPairGenerator
for more details.
| Modifier and Type | Class and Description |
|---|---|
| private static record |
| Modifier and Type | Field and Description |
|---|---|
| private final NamedKeyFactory | |
| private final String |
| Access | Constructor and Description |
|---|---|
| protected | NamedKEM(String
the family name fname, NamedKeyFactory the fac)KeyFactory used to translate foreign keys and
perform key validationCreates a new |
| Modifier and Type | Method and Description |
|---|---|
| public KEMSpi. | engineNewDecapsulator(PrivateKey privateKey, AlgorithmParameterSpec spec)
Implements javax. Creates a KEM decapsulator on the KEM receiver side. |
| public KEMSpi. | engineNewEncapsulator(PublicKey publicKey, AlgorithmParameterSpec spec, SecureRandom secureRandom)
Implements javax. Creates a KEM encapsulator on the KEM sender side. |
| private static NamedKEM. | |
| protected Object | Returns: a parsed key,null if none.parameter name pname, byte[] private key in raw bytes sk)User-defined function to validate a private key. |
| protected Object | Returns: a parsed key,null if none.parameter name pname, byte[] public key in raw bytes pk)User-defined function to validate a public key. |
| protected abstract byte[] | Returns: the shared keyparameter name pname, byte[] private key in raw bytes sk, Object parsed private key, sk2, byte[] null if none. See implCheckPrivateKey.the key encapsulation message encap)User-defined decap function. |
| protected abstract byte[][] | Returns: the key encapsulation message and the shared key (in this order)parameter name pname, byte[] public key in raw bytes pk, Object parsed public key, pk2, SecureRandom null if none. See implCheckPublicKey.SecureRandom object, sr)null if not initializedUser-defined encap function. |
| protected abstract int | Returns: key encapsulation message lengthparameter name pname)User-defined function returning key encapsulation message length. |
| protected abstract int | Returns: shared secret key lengthparameter name pname)User-defined function returning shared secret key length. |
| fac | back to summary |
|---|---|
| private final NamedKeyFactory fac | |
| fname | back to summary |
|---|---|
| private final String fname | |
| NamedKEM | back to summary |
|---|---|
| protected NamedKEM(String fname, NamedKeyFactory fac) Creates a new
| |
| engineNewDecapsulator | back to summary |
|---|---|
| public KEMSpi. Implements javax. Doc from javax. Creates a KEM decapsulator on the KEM receiver side.
| |
| engineNewEncapsulator | back to summary |
|---|---|
| public KEMSpi. Implements javax. Doc from javax. Creates a KEM encapsulator on the KEM sender side.
| |
| getKeyConsumerImpl | back to summary |
|---|---|
| private static NamedKEM. | |
| implCheckPrivateKey | back to summary |
|---|---|
| protected Object implCheckPrivateKey(String pname, byte[] sk) throws InvalidKeyException User-defined function to validate a private key. This method will be called in The default implementation returns
| |
| implCheckPublicKey | back to summary |
|---|---|
| protected Object implCheckPublicKey(String pname, byte[] pk) throws InvalidKeyException User-defined function to validate a public key. This method will be called in The default implementation returns
| |
| implDecapsulate | back to summary |
|---|---|
| protected abstract byte[] implDecapsulate(String pname, byte[] sk, Object sk2, byte[] encap) throws DecapsulateException User-defined decap function.
| |
| implEncapsulate | back to summary |
|---|---|
| protected abstract byte[][] implEncapsulate(String pname, byte[] pk, Object pk2, SecureRandom sr) User-defined encap function.
| |
| implEncapsulationSize | back to summary |
|---|---|
| protected abstract int implEncapsulationSize(String pname) User-defined function returning key encapsulation message length.
| |
| implSecretSize | back to summary |
|---|---|
| protected abstract int implSecretSize(String pname) User-defined function returning shared secret key length.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final Object | |
| private final NamedKEM | |
| private final byte[] | |
| private final String | |
| private final SecureRandom | |
| private final int |
| Access | Constructor and Description |
|---|---|
| private | KeyConsumerImpl(NamedKEM kem, String pname, int sslen, int clen, byte[] key, Object k2, SecureRandom sr)
|
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public SecretKey | engineDecapsulate(byte[] encapsulation, int from, int to, String algorithm)
Implements javax. The key decapsulation function. |
| public KEM. | engineEncapsulate(int from, int to, String algorithm)
Implements javax. The key encapsulation function. |
| public int | engineEncapsulationSize()
Implements javax. Returns the size of the key encapsulation message. |
| public int | engineSecretSize()
Implements javax. Returns the size of the shared secret. |
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public Object | |
| public NamedKEM | |
| public byte[] | |
| public String | |
| public SecureRandom | |
| public int | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| clen | back to summary |
|---|---|
| private final int clen Record Component accessed by clen(). | |
| k2 | back to summary |
|---|---|
| private final Object k2 Record Component accessed by k2(). | |
| kem | back to summary |
|---|---|
| private final NamedKEM kem Record Component accessed by kem(). | |
| key | back to summary |
|---|---|
| private final byte[] key Record Component accessed by key(). | |
| pname | back to summary |
|---|---|
| private final String pname Record Component accessed by pname(). | |
| sr | back to summary |
|---|---|
| private final SecureRandom sr Record Component accessed by sr(). | |
| sslen | back to summary |
|---|---|
| private final int sslen Record Component accessed by sslen(). | |
| KeyConsumerImpl | back to summary |
|---|---|
| private KeyConsumerImpl(NamedKEM kem, String pname, int sslen, int clen, byte[] key, Object k2, SecureRandom sr) | |
| clen | back to summary |
|---|---|
| public int clen() Record Component getter of clen. | |
| engineDecapsulate | back to summary |
|---|---|
| public SecretKey engineDecapsulate(byte[] encapsulation, int from, int to, String algorithm) throws DecapsulateException Implements javax. Doc from javax. The key decapsulation function. An invocation of this method recovers the secret key from the key encapsulation message.
An implementation must support the case where
| |
| engineEncapsulate | back to summary |
|---|---|
| public KEM. Implements javax. Doc from javax. The key encapsulation function.
Each invocation of this method must generate a new secret key and key
encapsulation message that is returned in an
An implementation must support the case where
| |
| engineEncapsulationSize | back to summary |
|---|---|
| public int engineEncapsulationSize() Implements javax. Doc from javax. Returns the size of the key encapsulation message.
| |
| engineSecretSize | back to summary |
|---|---|
| public int engineSecretSize() Implements javax. Doc from javax. Returns the size of the shared secret.
| |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| k2 | back to summary |
|---|---|
| public Object k2() Record Component getter of k2. | |
| kem | back to summary |
|---|---|
| public NamedKEM kem() Record Component getter of kem. | |
| key | back to summary |
|---|---|
| public byte[] key() Record Component getter of key. | |
| pname | back to summary |
|---|---|
| public String pname() Record Component getter of pname. | |
| sr | back to summary |
|---|---|
| public SecureRandom sr() Record Component getter of sr. | |
| sslen | back to summary |
|---|---|
| public int sslen() Record Component getter of sslen. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |