Interface X509JWK<A extends PublicKey,B extends PrivateKey>
- Type Parameters:
A
- the public key typeB
- the private key type
- All Superinterfaces:
AsymmetricJWK<A,
,B> JWK
An asymmetric JSON Web key that supports X.509 JOSE header parameters: x5u, x5c, x5t and x5t#S256.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
Fields inherited from interface io.inverno.mod.security.jose.jwk.JWK
DEFAULT_THUMBPRINT_DIGEST, KEY_OP_DECRYPT, KEY_OP_DERIVE_BITS, KEY_OP_DERIVE_KEY, KEY_OP_ENCRYPT, KEY_OP_SIGN, KEY_OP_UNWRAP_KEY, KEY_OP_VERIFY, KEY_OP_WRAP_KEY, USE_ENC, USE_SIG
-
Method Summary
Modifier and TypeMethodDescriptionReturns the resolved certificate defining the public key.String[]
Returns the X.509 certificate chain as defined by RFC7517 Section 4.7.Returns the X.509 SHA1 certificate thumbprint as defined by RFC7517 Section 4.8.Returns the X.509 SHA256 certificate thumbprint as defined by RFC7517 Section 4.9.Returns the X.509 certificate or certificates chain URL parameter as defined by RFC7517 Section 4.6.Returns a public and safe to share representation of the key.trust()
Trusts the key explicitly.Methods inherited from interface io.inverno.mod.security.jose.jwk.AsymmetricJWK
toPrivateKey, toPublicKey
Methods inherited from interface io.inverno.mod.security.jose.jwk.JWK
cipher, cipher, equals, getAlgorithm, getKeyId, getKeyOperations, getKeyType, getPublicKeyUse, hashCode, isTrusted, keyManager, keyManager, minify, signer, signer, supportsAlgorithm, toJWKThumbprint, toJWKThumbprint
-
Method Details
-
getX509CertificateURL
URI getX509CertificateURL()Returns the X.509 certificate or certificates chain URL parameter as defined by RFC7517 Section 4.6.
The certificates chain located at the URL must be in PEM format. The certificate containing the public key must be the first certificate. The key in the first certificate MUST match the public key represented by other members of the JWK.
- Returns:
- the X.509 URI or null
-
getX509CertificateChain
String[] getX509CertificateChain()Returns the X.509 certificate chain as defined by RFC7517 Section 4.7.
Each certificate is encoded in Base64 DER PKIX certificate value. The certificate containing the public key must be the first certificate. The key in the first certificate MUST match the public key represented by other members of the JWK.
- Returns:
- the X.509 certificate chain or null
-
getX509CertificateSHA1Thumbprint
String getX509CertificateSHA1Thumbprint()Returns the X.509 SHA1 certificate thumbprint as defined by RFC7517 Section 4.8.
This fingerprint can be used to identify the actual certificate which must MUST match the public key represented by other members of the JWK.
- Returns:
- the X.509 SHA1 thumbprint or null
-
getX509CertificateSHA256Thumbprint
String getX509CertificateSHA256Thumbprint()Returns the X.509 SHA256 certificate thumbprint as defined by RFC7517 Section 4.9.
This fingerprint can be used to identify the actual certificate which must MUST match the public key represented by other members of the JWK.
- Returns:
- the X.509 SHA1 thumbprint or null
-
getX509Certificate
Optional<X509Certificate> getX509Certificate()Returns the resolved certificate defining the public key.
- Returns:
- an optional containing the resolved certificate or an empty certificate if no certificate could have been resolve when building or reading the key
-
toPublicJWK
Description copied from interface:JWK
Returns a public and safe to share representation of the key.
- Specified by:
toPublicJWK
in interfaceAsymmetricJWK<A extends PublicKey,
B extends PrivateKey> - Specified by:
toPublicJWK
in interfaceJWK
- Returns:
- a public representation of this JWK
-
trust
Description copied from interface:JWK
Trusts the key explicitly.
This should be used with care when the authenticity of an untrusted key has been established through external means.
- Specified by:
trust
in interfaceAsymmetricJWK<A extends PublicKey,
B extends PrivateKey> - Specified by:
trust
in interfaceJWK
- Returns:
- this JWK
-