Package co.cryptoservice.sdk
Record Class KeyExportResult
java.lang.Object
java.lang.Record
co.cryptoservice.sdk.KeyExportResult
- Record Components:
algorithm- algorithm of the key, e.g. ed25519, x25519, ml-kem-768, x25519-ml-kem-768, ml-dsa-65, slh-dsa-sha2-128fkeyId- identifier of the server-held key; use it with the signing, decryption and decapsulation routesmlKemPublicKey- ML-KEM-768 public key (x25519-ml-kem-768); lowercase hex, or null when absentmlKemSecretKey- ML-KEM-768 secret key (x25519-ml-kem-768); lowercase hex, or null when absentprivateKey- private key (POST /v2/keys/generate and POST /v2/hpke/keygen); lowercase hex, or null when absentpublicKey- public key (single-key algorithms); lowercase hex, or null when absentsecretKey- secret key (POST /v2/pq/keygen, /v2/pq/dsa/keygen, /v2/pq/slh-dsa/keygen); lowercase hex, or null when absentx25519PrivateKey- X25519 private key (x25519-ml-kem-768); lowercase hex, or null when absentx25519PublicKey- X25519 public key (x25519-ml-kem-768); lowercase hex, or null when absent
public record KeyExportResult(String algorithm, String keyId, String mlKemPublicKey, String mlKemSecretKey, String privateKey, String publicKey, String secretKey, String x25519PrivateKey, String x25519PublicKey)
extends Record
What
POST /v2/keys/export answers: export a server-held private key.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealgorithmrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.keyId()Returns the value of thekeyIdrecord component.Returns the value of themlKemPublicKeyrecord component.byte[]mlKemPublicKey()decoded from hex.Returns the value of themlKemSecretKeyrecord component.byte[]mlKemSecretKey()decoded from hex.Returns the value of theprivateKeyrecord component.byte[]privateKey()decoded from hex.Returns the value of thepublicKeyrecord component.byte[]publicKey()decoded from hex.Returns the value of thesecretKeyrecord component.byte[]secretKey()decoded from hex.toString()Names the members; values that may be secret (keys, plaintexts, passwords, signatures) are redacted.Returns the value of thex25519PrivateKeyrecord component.byte[]x25519PrivateKey()decoded from hex.Returns the value of thex25519PublicKeyrecord component.byte[]x25519PublicKey()decoded from hex.
-
Constructor Details
-
KeyExportResult
public KeyExportResult(String algorithm, String keyId, String mlKemPublicKey, String mlKemSecretKey, String privateKey, String publicKey, String secretKey, String x25519PrivateKey, String x25519PublicKey) Creates an instance of aKeyExportResultrecord class.- Parameters:
algorithm- the value for thealgorithmrecord componentkeyId- the value for thekeyIdrecord componentmlKemPublicKey- the value for themlKemPublicKeyrecord componentmlKemSecretKey- the value for themlKemSecretKeyrecord componentprivateKey- the value for theprivateKeyrecord componentpublicKey- the value for thepublicKeyrecord componentsecretKey- the value for thesecretKeyrecord componentx25519PrivateKey- the value for thex25519PrivateKeyrecord componentx25519PublicKey- the value for thex25519PublicKeyrecord component
-
-
Method Details
-
mlKemPublicKeyBytes
public byte[] mlKemPublicKeyBytes()mlKemPublicKey()decoded from hex.- Returns:
- the bytes, or null when
mlKemPublicKeyis absent - Throws:
IllegalArgumentException- when the server sent malformed hex
-
mlKemSecretKeyBytes
public byte[] mlKemSecretKeyBytes()mlKemSecretKey()decoded from hex.- Returns:
- the bytes, or null when
mlKemSecretKeyis absent - Throws:
IllegalArgumentException- when the server sent malformed hex
-
privateKeyBytes
public byte[] privateKeyBytes()privateKey()decoded from hex.- Returns:
- the bytes, or null when
privateKeyis absent - Throws:
IllegalArgumentException- when the server sent malformed hex
-
publicKeyBytes
public byte[] publicKeyBytes()publicKey()decoded from hex.- Returns:
- the bytes, or null when
publicKeyis absent - Throws:
IllegalArgumentException- when the server sent malformed hex
-
secretKeyBytes
public byte[] secretKeyBytes()secretKey()decoded from hex.- Returns:
- the bytes, or null when
secretKeyis absent - Throws:
IllegalArgumentException- when the server sent malformed hex
-
x25519PrivateKeyBytes
public byte[] x25519PrivateKeyBytes()x25519PrivateKey()decoded from hex.- Returns:
- the bytes, or null when
x25519PrivateKeyis absent - Throws:
IllegalArgumentException- when the server sent malformed hex
-
x25519PublicKeyBytes
public byte[] x25519PublicKeyBytes()x25519PublicKey()decoded from hex.- Returns:
- the bytes, or null when
x25519PublicKeyis absent - Throws:
IllegalArgumentException- when the server sent malformed hex
-
toString
Names the members; values that may be secret (keys, plaintexts, passwords, signatures) are redacted. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
algorithm
Returns the value of thealgorithmrecord component.- Returns:
- the value of the
algorithmrecord component
-
keyId
Returns the value of thekeyIdrecord component.- Returns:
- the value of the
keyIdrecord component
-
mlKemPublicKey
Returns the value of themlKemPublicKeyrecord component.- Returns:
- the value of the
mlKemPublicKeyrecord component
-
mlKemSecretKey
Returns the value of themlKemSecretKeyrecord component.- Returns:
- the value of the
mlKemSecretKeyrecord component
-
privateKey
Returns the value of theprivateKeyrecord component.- Returns:
- the value of the
privateKeyrecord component
-
publicKey
Returns the value of thepublicKeyrecord component.- Returns:
- the value of the
publicKeyrecord component
-
secretKey
Returns the value of thesecretKeyrecord component.- Returns:
- the value of the
secretKeyrecord component
-
x25519PrivateKey
Returns the value of thex25519PrivateKeyrecord component.- Returns:
- the value of the
x25519PrivateKeyrecord component
-
x25519PublicKey
Returns the value of thex25519PublicKeyrecord component.- Returns:
- the value of the
x25519PublicKeyrecord component
-