Package com.nimbusds.oauth2.sdk.auth
Class X509CertificateConfirmation
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.auth.X509CertificateConfirmation
-
@Immutable public final class X509CertificateConfirmation extends Object
X.509 certificate SHA-256 confirmation.
-
-
Constructor Summary
Constructors Constructor Description X509CertificateConfirmation(com.nimbusds.jose.util.Base64URL x5tS256)
Creates a new X.509 certificate SHA-256 confirmation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.nimbusds.jwt.JWTClaimsSet
applyTo(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet)
Applies this X.509 certificate SHA-256 confirmation to the specified JWT claims set.boolean
equals(Object o)
com.nimbusds.jose.util.Base64URL
getValue()
Returns the X.509 certificate SHA-256 thumbprint.int
hashCode()
static X509CertificateConfirmation
of(X509Certificate x509Cert)
Creates a confirmation of the specified X.509 certificate.static X509CertificateConfirmation
parse(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet)
Parses a X.509 certificate confirmation from the specified JWT claims set.static X509CertificateConfirmation
parse(net.minidev.json.JSONObject jsonObject)
Parses a X.509 certificate confirmation from the specified JSON object representation of a JWT claims set.static X509CertificateConfirmation
parseFromConfirmationJSONObject(net.minidev.json.JSONObject cnf)
Parses a X.509 certificate confirmation from the specified confirmation ("cnf") JSON object.net.minidev.json.JSONObject
toJSONObject()
Returns this X.509 certificate SHA-256 confirmation as a JSON object.Map.Entry<String,net.minidev.json.JSONObject>
toJWTClaim()
Returns this X.509 certificate SHA-256 confirmation as a JWT claim.String
toString()
-
-
-
Constructor Detail
-
X509CertificateConfirmation
public X509CertificateConfirmation(com.nimbusds.jose.util.Base64URL x5tS256)
Creates a new X.509 certificate SHA-256 confirmation.- Parameters:
x5tS256
- The X.509 certificate SHA-256 thumbprint. Must not benull
.
-
-
Method Detail
-
getValue
public com.nimbusds.jose.util.Base64URL getValue()
Returns the X.509 certificate SHA-256 thumbprint.- Returns:
- The X.509 certificate SHA-256 thumbprint.
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject()
Returns this X.509 certificate SHA-256 confirmation as a JSON object.Example:
{ "cnf" : { "x5t#S256" : "bwcK0esc3ACC3DB2Y5_lESsXE8o9ltc05O89jdN-dg2" } }
- Returns:
- The JSON object.
-
toJWTClaim
public Map.Entry<String,net.minidev.json.JSONObject> toJWTClaim()
Returns this X.509 certificate SHA-256 confirmation as a JWT claim.Example:
"cnf" : { "x5t#S256" : "bwcK0esc3ACC3DB2Y5_lESsXE8o9ltc05O89jdN-dg2" }
- Returns:
- The JWT claim name / value.
-
applyTo
public com.nimbusds.jwt.JWTClaimsSet applyTo(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet)
Applies this X.509 certificate SHA-256 confirmation to the specified JWT claims set.- Parameters:
jwtClaimsSet
- The JWT claims set.- Returns:
- The modified JWT claims set.
-
parse
public static X509CertificateConfirmation parse(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet)
Parses a X.509 certificate confirmation from the specified JWT claims set.- Parameters:
jwtClaimsSet
- The JWT claims set.- Returns:
- The X.509 certificate confirmation,
null
if not found.
-
parse
public static X509CertificateConfirmation parse(net.minidev.json.JSONObject jsonObject)
Parses a X.509 certificate confirmation from the specified JSON object representation of a JWT claims set.- Parameters:
jsonObject
- The JSON object.- Returns:
- The X.509 certificate confirmation,
null
if not found.
-
parseFromConfirmationJSONObject
public static X509CertificateConfirmation parseFromConfirmationJSONObject(net.minidev.json.JSONObject cnf)
Parses a X.509 certificate confirmation from the specified confirmation ("cnf") JSON object.- Parameters:
cnf
- The confirmation JSON object,null
if none.- Returns:
- The X.509 certificate confirmation,
null
if not found.
-
of
public static X509CertificateConfirmation of(X509Certificate x509Cert)
Creates a confirmation of the specified X.509 certificate.- Parameters:
x509Cert
- The X.509 certificate.- Returns:
- The X.509 certificate confirmation.
-
-