Class JwtCNonceHandler

java.lang.Object
org.keycloak.protocol.oid4vc.issuance.keybinding.JwtCNonceHandler
All Implemented Interfaces:
CNonceHandler, org.keycloak.provider.Provider

public class JwtCNonceHandler extends Object implements CNonceHandler
Author:
Pascal Knüppel
  • Field Details

  • Constructor Details

    • JwtCNonceHandler

      public JwtCNonceHandler(org.keycloak.models.KeycloakSession keycloakSession)
  • Method Details

    • buildCNonce

      public String buildCNonce(List<String> audiences, Map<String,Object> additionalDetails)
      Description copied from interface: CNonceHandler
      used to build a cNonce in any style. For jwt-based cNonces we will additionally require the audience-values that should be added into the cNonce
      Specified by:
      buildCNonce in interface CNonceHandler
      Parameters:
      audiences - the audiences for jwt-based cNonces
      additionalDetails - additional attributes that might be required to build the cNonce and that are handler specific
      Returns:
      the cNonce in string representation
    • verifyCNonce

      public void verifyCNonce(String cNonce, List<String> audiences, @Nullable Map<String,Object> additionalDetails) throws org.keycloak.common.VerificationException
      Description copied from interface: CNonceHandler
      must verify the validity of a cNonce value that has been issued by the CNonceHandler.buildCNonce(List, Map) method.
      Specified by:
      verifyCNonce in interface CNonceHandler
      Parameters:
      cNonce - the cNonce to validate
      audiences - the expected audiences for jwt-based cNonces
      additionalDetails - additional attributes that might be required to build the cNonce and that are handler specific
      Throws:
      org.keycloak.common.VerificationException
    • checkAttributeEquality

      protected boolean checkAttributeEquality(String key, Object object, Object actualValue) throws org.keycloak.common.VerificationException
      Throws:
      org.keycloak.common.VerificationException
    • selectSigningKey

      protected org.keycloak.crypto.KeyWrapper selectSigningKey(org.keycloak.models.RealmModel realm)