public class MLKEMPrivateKey
extends iaik.pkcs.pkcs8.PrivateKeyInfo
Constructor and Description |
---|
MLKEMPrivateKey(byte[] encoded)
Create private key from an ASN.1 encoded byte sequence
|
MLKEMPrivateKey(byte[] byteDk,
byte[] byteEk,
byte[] byteHashedEk,
byte[] z,
MLKEMParameterSpec parameterSpec)
Create private key from private key byte array, public key byte array, public key hash and seed z
|
MLKEMPrivateKey(byte[] byteRawEncoded,
MLKEMParameterSpec parameterSpec)
Create private key from raw byte array only, which contains the private key,
optionally the public key, the hash of the public key and the seed
|
Modifier and Type | Method and Description |
---|---|
protected void |
decode(byte[] bytes) |
protected byte[] |
encode() |
boolean |
equals(Object o) |
String |
getAlgorithm() |
byte[] |
getRawEncoded()
Returns the private key as a byte array (raw data).
|
int |
hashCode() |
String |
toString() |
clone, createPrivateKeyInfo, decode, getAlgorithmID, getAttributes, getEncoded, getFormat, getPrivateKey, getPrivateKey, getPrivateKey, getPrivateKey, getPrivateKey, getPrivateKey, getPubKey, setAttributes, setPubKey, toASN1Object, writeTo
finalize, getClass, notify, notifyAll, wait, wait, wait
destroy, isDestroyed
public MLKEMPrivateKey(byte[] byteDk, byte[] byteEk, byte[] byteHashedEk, byte[] z, MLKEMParameterSpec parameterSpec) throws InvalidKeyException
byteDk
- private key (KEM decaps key) as a byte sequencebyteEk
- public key (KEM encaps key) as a byte sequencebyteHashedEk
- public key hashz
- seedparameterSpec
- the given specification of the parametersInvalidKeyException
- throws an error if failing to create the encoding of the private keypublic MLKEMPrivateKey(byte[] byteRawEncoded, MLKEMParameterSpec parameterSpec) throws InvalidKeyException
byteRawEncoded
- raw byte array which contains the private key, optionally the public key, the hash of the public key and the seedparameterSpec
- the given specification of the parametersInvalidKeyException
- throws an error if failing to create the encoding of the private keypublic MLKEMPrivateKey(byte[] encoded) throws InvalidKeyException
encoded
- private key encoded as ASN.1 byte sequenceInvalidKeyException
- if the encoding is not validpublic byte[] getRawEncoded()
byteDk
||byteEk
||byteHashedEk
||z
)protected void decode(byte[] bytes) throws InvalidKeyException
decode
in class iaik.pkcs.pkcs8.PrivateKeyInfo
InvalidKeyException
protected byte[] encode()
encode
in class iaik.pkcs.pkcs8.PrivateKeyInfo
public String getAlgorithm()
getAlgorithm
in interface Key
getAlgorithm
in class iaik.pkcs.pkcs8.PrivateKeyInfo
public boolean equals(Object o)
equals
in class iaik.pkcs.pkcs8.PrivateKeyInfo
public int hashCode()
hashCode
in class iaik.pkcs.pkcs8.PrivateKeyInfo
public String toString()
toString
in class iaik.pkcs.pkcs8.PrivateKeyInfo
Copyright © 2020–2024 Stiftung SIC. All rights reserved.