Package org.forgerock.json.jose.jwk
Class RsaJWK
java.lang.Object
org.forgerock.json.jose.jwk.JWK
org.forgerock.json.jose.jwk.RsaJWK
Implements a RsaJWK.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
The RSA JWK builder.static class
Holds the other prime factors. -
Field Summary
Fields inherited from class org.forgerock.json.jose.jwk.JWK
JSON_KEY_ALG, JSON_KEY_KID, JSON_KEY_KTY, JSON_KEY_OPERATIONS, JSON_KEY_USE, JSON_KEY_X5C, JSON_KEY_X5T, JSON_KEY_X5T_S256, JSON_KEY_X5U
-
Constructor Summary
ConstructorDescriptionRsaJWK
(String use, String alg, String kid, String modulus, String publicExponent, String primeP, String primeQ, String primePExponent, String primeQExponent, String crtCoefficient, String x5u, String x5t, List<String> x5c) Deprecated.Use the builder instead.RsaJWK
(String use, String alg, String kid, String modulus, String publicExponent, String privateExponent, String primeP, String primeQ, String primePExponent, String primeQExponent, String crtCoefficient, List<RsaJWK.PrimesInfo> otherPrimesInfo, String x5u, String x5t, List<String> x5c) Deprecated.Use the builder instead.RsaJWK
(String use, String alg, String kid, String modulus, String publicExponent, String privateExponent, String x5u, String x5t, List<String> x5c) Deprecated.Use the builder instead.RsaJWK
(String use, String alg, String kid, String modulus, String publicExponent, String x5u, String x5t, List<String> x5c) Deprecated.Use the builder instead.RsaJWK
(RSAPublicKey key, String use, String alg, String kid, String x5u, String x5t, List<String> x5c) Deprecated.Use the builder instead.RsaJWK
(RSAPublicKey pubKey, RSAPrivateCrtKey privCert, String use, String alg, String kid, String x5u, String x5t, List<String> x5c) Deprecated.Use the builder instead.RsaJWK
(RSAPublicKey pubKey, RSAPrivateKey privKey, String use, String alg, String kid, String x5u, String x5t, List<String> x5c) Deprecated.Use the builder instead. -
Method Summary
Modifier and TypeMethodDescriptionstatic RsaJWK.Builder
Get the builder.static RsaJWK.Builder
builder
(RSAPublicKey publicKey) Get the builder.Get the RSA First CRT Coefficient value.Get the RSA modulus value.Get the RSA other factors value.Get the RSA First Prime Factor value.Get the RSA First Factor CRT Exponent value.Get the RSA Second Prime Factor value.Get the RSA Second factor CRT Exponent value.Get the RSA Private Exponent value.Get the RSA Public Exponent.protected Optional<JWK.Builder<?>>
Return a builder with all the values set for representing the public components of the JWK.boolean
Indicates if any private key attributes are present in the JWK.static RsaJWK
Parses a RsaJWK from a json string.static RsaJWK
Parses a RsaJWK from a jsonValue Object.Returns a json representation of the JWK.Create a KeyPair using the JWK.Creates a RSAPrivateKey from the JWK.Creates a RSAPublicKey from the JWK.Methods inherited from class org.forgerock.json.jose.jwk.JWK
getAlgorithm, getAlgorithm, getJwaAlgorithm, getJwkThumbprint, getKeyId, getKeyOperations, getKeyType, getUse, getX509Chain, getX509Thumbnail, getX509Thumbprint, getX509ThumbprintS256, getX509URL, loadJWKFromJson, putField, toCryptoKey, toJsonString, toJsonValue, toPublicJwk, toSecretBuilder
-
Constructor Details
-
RsaJWK
@Deprecated public RsaJWK(String use, String alg, String kid, String modulus, String publicExponent, String x5u, String x5t, List<String> x5c) Deprecated.Use the builder instead.Creates a RsaJWK.- Parameters:
use
- the use of the JWKalg
- the alg of the JWKkid
- the key id of the JWKmodulus
- the modulus of the JWKpublicExponent
- the public exponent JWKx5u
- the x509 url for the keyx5t
- the x509 thumbnail for the keyx5c
- the x509 chain as a list of Base64 encoded strings
-
RsaJWK
@Deprecated public RsaJWK(String use, String alg, String kid, String modulus, String publicExponent, String privateExponent, String x5u, String x5t, List<String> x5c) Deprecated.Use the builder instead.Creates a RsaJWK.- Parameters:
use
- the use of the JWKalg
- the alg of the JWKkid
- the key id of the JWKmodulus
- the modulus of the JWKpublicExponent
- the public exponent JWKprivateExponent
- the private exponent JWKx5u
- the x509 url for the keyx5t
- the x509 thumbnail for the keyx5c
- the x509 chain as a list of Base64 encoded strings
-
RsaJWK
@Deprecated public RsaJWK(String use, String alg, String kid, String modulus, String publicExponent, String primeP, String primeQ, String primePExponent, String primeQExponent, String crtCoefficient, String x5u, String x5t, List<String> x5c) Deprecated.Use the builder instead.Creates a RsaJWK.- Parameters:
use
- the use of the JWKalg
- the alg of the JWKkid
- the key id of the JWKmodulus
- the modulus of the JWKpublicExponent
- the public exponent JWKprimeP
- the first prime factor of the JWKprimeQ
- the second prime factor of the JWKprimePExponent
- the first factor exponent of the JWKprimeQExponent
- the second factor exponent of the JWKcrtCoefficient
- the first CRT Coefficient of the JWKx5u
- the x509 url for the keyx5t
- the x509 thumbnail for the keyx5c
- the x509 chain as a list of Base64 encoded strings
-
RsaJWK
@Deprecated public RsaJWK(String use, String alg, String kid, String modulus, String publicExponent, String privateExponent, String primeP, String primeQ, String primePExponent, String primeQExponent, String crtCoefficient, List<RsaJWK.PrimesInfo> otherPrimesInfo, String x5u, String x5t, List<String> x5c) Deprecated.Use the builder instead.Creates a RsaJWK.- Parameters:
use
- the use of the JWKalg
- the alg of the JWKkid
- the key id of the JWKmodulus
- the modulus of the JWKpublicExponent
- the public exponent JWKprivateExponent
- the private exponent JWKprimeP
- the first prime factor of the JWKprimeQ
- the second prime factor of the JWKprimePExponent
- the first factor exponent of the JWKprimeQExponent
- the second factor exponent of the JWKcrtCoefficient
- the first CRT Coefficient of the JWKotherPrimesInfo
- the extra factors of the JWKx5u
- the x509 url for the keyx5t
- the x509 thumbnail for the keyx5c
- the x509 chain as a list of Base64 encoded strings
-
RsaJWK
@Deprecated public RsaJWK(RSAPublicKey key, String use, String alg, String kid, String x5u, String x5t, List<String> x5c) Deprecated.Use the builder instead.Creates a RsaJWK.- Parameters:
key
- the RSAPublicKey to useuse
- the use of the JWKalg
- the alg of the JWKkid
- the key id of the JWKx5u
- the x509 url for the keyx5t
- the x509 thumbnail for the keyx5c
- the x509 chain as a list of Base64 encoded strings
-
RsaJWK
@Deprecated public RsaJWK(RSAPublicKey pubKey, RSAPrivateKey privKey, String use, String alg, String kid, String x5u, String x5t, List<String> x5c) Deprecated.Use the builder instead.Creates a RsaJWK.- Parameters:
pubKey
- the RSAPublicKey to useprivKey
- the RSAPrivateKey to useuse
- the use of the JWKalg
- the alg of the JWKkid
- the key id of the JWKx5u
- the x509 url for the keyx5t
- the x509 thumbnail for the keyx5c
- the x509 chain as a list of Base64 encoded strings
-
RsaJWK
@Deprecated public RsaJWK(RSAPublicKey pubKey, RSAPrivateCrtKey privCert, String use, String alg, String kid, String x5u, String x5t, List<String> x5c) Deprecated.Use the builder instead.Creates a RsaJWK.- Parameters:
pubKey
- the RSAPublicKey to useprivCert
- the RSAPrivateCrtKey to useuse
- the use of the JWKalg
- the alg of the JWKkid
- the key id of the JWKx5u
- the x509 url for the keyx5t
- the x509 thumbnail for the keyx5c
- the x509 chain as a list of Base64 encoded strings
-
-
Method Details
-
builder
Get the builder.- Parameters:
modulus
- the modulus of the JWKpublicExponent
- the public exponent JWK- Returns:
- the RSA JWK builder
-
builder
Get the builder.- Parameters:
publicKey
- the RSAPublicKey to use- Returns:
- the RSA JWK builder
-
getModulus
Get the RSA modulus value.- Returns:
- a Base64url modulus value
-
getPublicExponent
Get the RSA Public Exponent.- Returns:
- a Base64url Public Exponent value
-
getPrivateExponent
Get the RSA Private Exponent value.- Returns:
- a Base64url Private Exponent value
-
getPrimeP
Get the RSA First Prime Factor value.- Returns:
- a Base64url First Prime Factor value
-
getPrimeQ
Get the RSA Second Prime Factor value.- Returns:
- a Base64url Second Prime Factor value
-
getPrimePExponent
Get the RSA First Factor CRT Exponent value.- Returns:
- a Base64url First Factor CRT Exponent value
-
getPrimeQExponent
Get the RSA Second factor CRT Exponent value.- Returns:
- a Base64url Second factor CRT Exponent value
-
getCRTCoefficient
Get the RSA First CRT Coefficient value.- Returns:
- a Base64url First CRT Coefficient value
-
getOtherPrimesInfo
Get the RSA other factors value.- Returns:
- a Base64url other factors value
-
toRSAPublicKey
Creates a RSAPublicKey from the JWK.- Returns:
- a RSAPublicKey
-
toRSAPrivateKey
Creates a RSAPrivateKey from the JWK.- Returns:
- a RSAPrivateKey
-
isPrivate
public boolean isPrivate()Description copied from class:JWK
Indicates if any private key attributes are present in the JWK. -
getPublicJwkBuilder
Description copied from class:JWK
Return a builder with all the values set for representing the public components of the JWK. Common JWK attributes will be added inJWK.toPublicJwk()
.- Specified by:
getPublicJwkBuilder
in classJWK
- Returns:
- The builder.
-
toKeyPair
Create a KeyPair using the JWK.- Returns:
- a KeyPair
-
parse
Parses a RsaJWK from a json string.- Parameters:
json
- a string json object- Returns:
- a RsaJWK
-
parse
Parses a RsaJWK from a jsonValue Object.- Parameters:
json
- a jsonValue object- Returns:
- a RsaJWK
-
toJsonValue
Description copied from class:JWK
Returns a json representation of the JWK.- Overrides:
toJsonValue
in classJWK
- Returns:
- A JSON representation.
-