public class KyberPrivateKey
extends iaik.pkcs.pkcs8.PrivateKeyInfo
Constructor and Description |
---|
KyberPrivateKey(byte[] encoded)
Create private key from an ASN.1 encoded byte sequence
|
KyberPrivateKey(byte[] byteDk,
byte[] byteEk,
byte[] byteHashedEk,
byte[] z,
KyberParameterSpec parameterSpec)
Create private key from private key byte array, public key byte array, public key hash and seed z
|
KyberPrivateKey(byte[] byteDk,
byte[] byteHashedEk,
byte[] z,
KyberParameterSpec parameterSpec)
Create private key from private key byte array, public key hash and seed z
|
KyberPrivateKey(byte[] byteRawEncoded,
KyberParameterSpec 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() |
protected 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 KyberPrivateKey(byte[] byteDk, byte[] byteEk, byte[] byteHashedEk, byte[] z, KyberParameterSpec 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 KyberPrivateKey(byte[] byteDk, byte[] byteHashedEk, byte[] z, KyberParameterSpec parameterSpec) throws InvalidKeyException
byteDk
- private key (KEM decaps 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 KyberPrivateKey(byte[] byteRawEncoded, KyberParameterSpec 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 KyberPrivateKey(byte[] encoded) throws InvalidKeyException
encoded
- private key encoded as ASN.1 byte sequenceInvalidKeyException
- if the encoding is not validprotected 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–2023 Stiftung SIC. All rights reserved.