Package co.cryptoservice.sdk
Record Class HybridEncapsulateResult
java.lang.Object
java.lang.Record
co.cryptoservice.sdk.HybridEncapsulateResult
- Record Components:
algorithm- hybrid KEM algorithmcombiner- shared-secret combinermlKemCiphertext- the 1088-byte ML-KEM-768 ciphertext; lowercase hex- the 32-byte shared secret; lowercase hexx25519EphemeralPublic- the 32-byte ephemeral X25519 public key; lowercase hex
public record HybridEncapsulateResult(String algorithm, String combiner, String mlKemCiphertext, String sharedSecret, String x25519EphemeralPublic)
extends Record
What
POST /v2/pq/hybrid/encapsulate answers: hybrid encapsulate (X25519 + ML-KEM-768).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealgorithmrecord component.combiner()Returns the value of thecombinerrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themlKemCiphertextrecord component.byte[]mlKemCiphertext()decoded from hex.Returns the value of thesharedSecretrecord component.byte[]sharedSecret()decoded from hex.toString()Names the members; values that may be secret (keys, plaintexts, passwords, signatures) are redacted.Returns the value of thex25519EphemeralPublicrecord component.byte[]x25519EphemeralPublic()decoded from hex.
-
Constructor Details
-
HybridEncapsulateResult
public HybridEncapsulateResult(String algorithm, String combiner, String mlKemCiphertext, String sharedSecret, String x25519EphemeralPublic) Creates an instance of aHybridEncapsulateResultrecord class.- Parameters:
algorithm- the value for thealgorithmrecord componentcombiner- the value for thecombinerrecord componentmlKemCiphertext- the value for themlKemCiphertextrecord componentsharedSecret- the value for thesharedSecretrecord componentx25519EphemeralPublic- the value for thex25519EphemeralPublicrecord component
-
-
Method Details
-
mlKemCiphertextBytes
public byte[] mlKemCiphertextBytes()mlKemCiphertext()decoded from hex.- Returns:
- the bytes, or null when
mlKemCiphertextis absent - Throws:
IllegalArgumentException- when the server sent malformed hex
-
x25519EphemeralPublicBytes
public byte[] x25519EphemeralPublicBytes()x25519EphemeralPublic()decoded from hex.- Returns:
- the bytes, or null when
x25519EphemeralPublicis 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
-
combiner
Returns the value of thecombinerrecord component.- Returns:
- the value of the
combinerrecord component
-
mlKemCiphertext
Returns the value of themlKemCiphertextrecord component.- Returns:
- the value of the
mlKemCiphertextrecord component
-
x25519EphemeralPublic
Returns the value of thex25519EphemeralPublicrecord component.- Returns:
- the value of the
x25519EphemeralPublicrecord component
-