Record Class EphemeralKey

java.lang.Object
java.lang.Record
org.keycloak.broker.oid4vp.EphemeralKey

public record EphemeralKey(String kid, JWK publicJwk, String privateKeyPkcs8Base64) extends Record
The per request response encryption key for the direct_post.jwt response mode. The public JWK is advertised to the wallet in the request object client metadata, the private key stays with the verifier to decrypt the response. Generation takes no algorithm because HAIP pins the key management to JWEConstants.ECDH_ES over secp256r1. The advertised content encryption algorithms only select the length of the content key derived during key agreement, so the one key serves them all.
  • Constructor Details

    • EphemeralKey

      public EphemeralKey(String kid, JWK publicJwk, String privateKeyPkcs8Base64)
      Creates an instance of a EphemeralKey record class.
      Parameters:
      kid - the value for the kid record component
      publicJwk - the value for the publicJwk record component
      privateKeyPkcs8Base64 - the value for the privateKeyPkcs8Base64 record component
  • Method Details

    • generate

      public static EphemeralKey generate(String kid)
    • privateKey

      public PrivateKey privateKey()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • kid

      public String kid()
      Returns the value of the kid record component.
      Returns:
      the value of the kid record component
    • publicJwk

      public JWK publicJwk()
      Returns the value of the publicJwk record component.
      Returns:
      the value of the publicJwk record component
    • privateKeyPkcs8Base64

      public String privateKeyPkcs8Base64()
      Returns the value of the privateKeyPkcs8Base64 record component.
      Returns:
      the value of the privateKeyPkcs8Base64 record component