Module io.inverno.mod.security.jose
Package io.inverno.mod.security.jose.jwk
Interface AsymmetricJWK<A extends PublicKey,B extends PrivateKey>
- Type Parameters:
A
- the public key typeB
- the private key type
- All Superinterfaces:
JWK
An asymmetric JSON Web Key based on asymmetric public and private keys.
- 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 TypeMethodDescriptionConverts the JWK to its corresponding private key.Returns a public and safe to share representation of the key.Converts the JWK to its corresponding public key.trust()
Trusts the key explicitly.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
-
toPublicKey
Converts the JWK to its corresponding public key.
- Returns:
- a public key
- Throws:
JWKProcessingException
- if there was an error converting the JWK to a public key
-
toPrivateKey
Converts the JWK to its corresponding private key.
- Returns:
- an optional containing the private key or an empty optional if the key does not contain private information
- Throws:
JWKProcessingException
- if there was an error converting the JWK to a private key
-
toPublicJWK
AsymmetricJWK<A,B> toPublicJWK()Description copied from interface:JWK
Returns a public and safe to share representation of the key.
- Specified by:
toPublicJWK
in interfaceJWK
- Returns:
- a public representation of this JWK
-
trust
AsymmetricJWK<A,B> 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.
-