Record Class KeyEncapsulationExchange.KeyExchangeResult
java.lang.Object
java.lang.Record
net.jrodolfo.java_evolution.java21.key_encapsulation.KeyEncapsulationExchange.KeyExchangeResult
- Record Components:
senderSecretBytes- the shared secret bytes created by the senderreceiverSecretBytes- the shared secret bytes recovered by the receiverencapsulation- the transmitted encapsulation messageproviderName- the provider selected for the sender-side KEM operation
- Enclosing class:
KeyEncapsulationExchange
-
Constructor Summary
ConstructorsConstructorDescriptionKeyExchangeResult(byte[] senderSecretBytes, byte[] receiverSecretBytes, byte[] encapsulation, String providerName) Creates an immutable exchange result. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Returns the value of theencapsulationrecord 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 theproviderNamerecord component.byte[]Returns the value of thereceiverSecretBytesrecord component.booleanShows whether both parties reached the same shared secret.byte[]Returns the value of thesenderSecretBytesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
KeyExchangeResult
public KeyExchangeResult(byte[] senderSecretBytes, byte[] receiverSecretBytes, byte[] encapsulation, String providerName) Creates an immutable exchange result.
-
-
Method Details
-
senderSecretBytes
public byte[] senderSecretBytes()Returns the value of thesenderSecretBytesrecord component.- Returns:
- the value of the
senderSecretBytesrecord component
-
receiverSecretBytes
public byte[] receiverSecretBytes()Returns the value of thereceiverSecretBytesrecord component.- Returns:
- the value of the
receiverSecretBytesrecord component
-
encapsulation
public byte[] encapsulation()Returns the value of theencapsulationrecord component.- Returns:
- the value of the
encapsulationrecord component
-
secretsMatch
public boolean secretsMatch()Shows whether both parties reached the same shared secret.- Returns:
truewhen sender and receiver key material matches
-
toString
-
hashCode
-
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). -
providerName
Returns the value of theproviderNamerecord component.- Returns:
- the value of the
providerNamerecord component
-