Package co.cryptoservice.sdk
Record Class HpkeSealResult
java.lang.Object
java.lang.Record
co.cryptoservice.sdk.HpkeSealResult
- Record Components:
ciphertext- the AEAD ciphertext, tag included; lowercase hexencapsulatedKey- the KEM encapsulated key (enc); lowercase hex
What
POST /v2/hpke/seal answers: encrypt (seal) a message using HPKE (RFC 9180).-
Constructor Summary
ConstructorsConstructorDescriptionHpkeSealResult(String ciphertext, String encapsulatedKey) Creates an instance of aHpkeSealResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theciphertextrecord component.byte[]ciphertext()decoded from hex.Returns the value of theencapsulatedKeyrecord component.byte[]encapsulatedKey()decoded from hex.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.toString()Names the members; values that may be secret (keys, plaintexts, passwords, signatures) are redacted.
-
Constructor Details
-
HpkeSealResult
Creates an instance of aHpkeSealResultrecord class.- Parameters:
ciphertext- the value for theciphertextrecord componentencapsulatedKey- the value for theencapsulatedKeyrecord component
-
-
Method Details
-
ciphertextBytes
public byte[] ciphertextBytes()ciphertext()decoded from hex.- Returns:
- the bytes, or null when
ciphertextis absent - Throws:
IllegalArgumentException- when the server sent malformed hex
-
encapsulatedKeyBytes
public byte[] encapsulatedKeyBytes()encapsulatedKey()decoded from hex.- Returns:
- the bytes, or null when
encapsulatedKeyis 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). -
ciphertext
Returns the value of theciphertextrecord component.- Returns:
- the value of the
ciphertextrecord component
-
encapsulatedKey
Returns the value of theencapsulatedKeyrecord component.- Returns:
- the value of the
encapsulatedKeyrecord component
-