- All Superinterfaces:
AsymmetricJWK<RSAPublicKey,
,RSAPrivateKey> JWK
,X509JWK<RSAPublicKey,
RSAPrivateKey>
RSA JSON Web Key.
An RSA JWK is asymmetric. The public key is composed of the modulus and the public exponent. The private key is defined by the private exponent. Other parameters can be present when the key is a multi prime key.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
RSA JSON Web Key other prime info. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
RSA key type as defined by RFC7518 Section 6.1.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 first coefficient encoded as Base64URL.Returns the first factor exponent encoded as Base64URL.Returns the first prime factor encoded as Base64URL.Returns the modulus encoded as Base64URL.Returns the list of other primes info.Returns the private exponent encoded as Base64URL.Returns the public exponent encoded as Base64URL.Returns the second factor exponent encoded as Base64URL.Returns the second prime factor encoded as Base64URL.minify()
Returns a minified representation of the key only containing required data.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, signer, signer, supportsAlgorithm, toJWKThumbprint, toJWKThumbprint
Methods inherited from interface io.inverno.mod.security.jose.jwk.X509JWK
getX509Certificate, getX509CertificateChain, getX509CertificateSHA1Thumbprint, getX509CertificateSHA256Thumbprint, getX509CertificateURL
-
Field Details
-
KEY_TYPE
RSA key type as defined by RFC7518 Section 6.1.- See Also:
-
-
Method Details
-
getModulus
String getModulus()Returns the modulus encoded as Base64URL.
- Returns:
- the Base64URL encoded modulus with no padding.
-
getPublicExponent
String getPublicExponent()Returns the public exponent encoded as Base64URL.
- Returns:
- the Base64URL encoded public exponent with no padding.
-
getPrivateExponent
String getPrivateExponent()Returns the private exponent encoded as Base64URL.
- Returns:
- the Base64URL encoded private exponent with no padding.
-
getFirstPrimeFactor
String getFirstPrimeFactor()Returns the first prime factor encoded as Base64URL.
- Returns:
- the Base64URL encoded first prime factor with no padding.
-
getSecondPrimeFactor
String getSecondPrimeFactor()Returns the second prime factor encoded as Base64URL.
- Returns:
- the Base64URL encoded second prime factor with no padding.
-
getFirstFactorExponent
String getFirstFactorExponent()Returns the first factor exponent encoded as Base64URL.
- Returns:
- the Base64URL encoded first factor exponent with no padding.
-
getSecondFactorExponent
String getSecondFactorExponent()Returns the second factor exponent encoded as Base64URL.
- Returns:
- the Base64URL encoded second factor exponent with no padding.
-
getFirstCoefficient
String getFirstCoefficient()Returns the first coefficient encoded as Base64URL.
- Returns:
- the Base64URL encoded first coefficient with no padding.
-
getOtherPrimesInfo
List<RSAJWK.OtherPrimeInfo> getOtherPrimesInfo()Returns the list of other primes info.
- Returns:
- the list of other primes info or null
-
toPublicJWK
RSAJWK toPublicJWK()Description copied from interface:JWK
Returns a public and safe to share representation of the key.
- Specified by:
toPublicJWK
in interfaceAsymmetricJWK<RSAPublicKey,
RSAPrivateKey> - Specified by:
toPublicJWK
in interfaceJWK
- Specified by:
toPublicJWK
in interfaceX509JWK<RSAPublicKey,
RSAPrivateKey> - Returns:
- a public representation of this JWK
-
minify
RSAJWK minify()Description copied from interface:JWK
Returns a minified representation of the key only containing required data.
Note that the returned JWK may contain private data.
-
trust
RSAJWK 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<RSAPublicKey,
RSAPrivateKey> - Specified by:
trust
in interfaceJWK
- Specified by:
trust
in interfaceX509JWK<RSAPublicKey,
RSAPrivateKey> - Returns:
- this JWK
-