Class DPoPUtils

java.lang.Object
com.nimbusds.oauth2.sdk.dpop.DPoPUtils

public final class DPoPUtils extends Object
DPoP utilities.
  • Method Details

    • createJWTClaimsSet

      @Deprecated public static com.nimbusds.jwt.JWTClaimsSet createJWTClaimsSet(JWTID jti, String htm, URI htu, Date iat, AccessToken accessToken) throws com.nimbusds.jose.JOSEException
      Deprecated.
      Creates a new DPoP JWT claims set.
      Parameters:
      jti - The JWT ID. Must not be null.
      htm - The HTTP request method. Must not be null.
      htu - The HTTP URI, without a query or fragment. Must not be null.
      iat - The issue time. Must not be null.
      accessToken - The access token for the access token hash ("ath") claim computation, null if not specified.
      Returns:
      The JWT claims set.
      Throws:
      com.nimbusds.jose.JOSEException - If a cryptographic exception was encountered.
    • createJWTClaimsSet

      public static com.nimbusds.jwt.JWTClaimsSet createJWTClaimsSet(JWTID jti, String htm, URI htu, Date iat, AccessToken accessToken, Nonce nonce) throws com.nimbusds.jose.JOSEException
      Creates a new DPoP JWT claims set.
      Parameters:
      jti - The JWT ID. Must not be null.
      htm - The HTTP request method. Must not be null.
      htu - The HTTP URI, without a query or fragment. Must not be null.
      iat - The issue time. Must not be null.
      accessToken - The access token for the access token hash ("ath") claim computation, null if not specified.
      nonce - The nonce, null if not specified.
      Returns:
      The JWT claims set.
      Throws:
      com.nimbusds.jose.JOSEException - If a cryptographic exception was encountered.
    • computeSHA256

      public static com.nimbusds.jose.util.Base64URL computeSHA256(AccessToken accessToken) throws com.nimbusds.jose.JOSEException
      Computes a SHA-256 hash for the specified access token.
      Parameters:
      accessToken - The access token. Must not be null.
      Returns:
      The hash, BASE64 URL encoded.
      Throws:
      com.nimbusds.jose.JOSEException - If hashing failed.