Package org.forgerock.json.jose.jwk
Class RsaJWK
java.lang.Object
org.forgerock.json.jose.jwt.JWObject
org.forgerock.json.jose.jwk.JWK
org.forgerock.json.jose.jwk.RsaJWK
Implements a RsaJWK.
-
Nested Class Summary
Nested Classes -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionRsaJWK
(RSAPublicKey pubKey, RSAPrivateCrtKey privCert, KeyUse use, String alg, String kid, String x5u, String x5t, List<String> x5c) Creates a RsaJWK.RsaJWK
(RSAPublicKey pubKey, RSAPrivateKey privKey, KeyUse use, String alg, String kid, String x5u, String x5t, List<String> x5c) Creates a RsaJWK.RsaJWK
(RSAPublicKey key, KeyUse use, String alg, String kid, String x5u, String x5t, List<String> x5c) Creates a RsaJWK.RsaJWK
(KeyUse use, String alg, String kid, String n, String e, String p, String q, String dp, String dq, String qi, String x5u, String x5t, List<String> x5c) Creates a RsaJWK.RsaJWK
(KeyUse use, String alg, String kid, String n, String e, String d, String p, String q, String dp, String dq, String qi, List<RsaJWK.OtherFactors> factors, String x5u, String x5t, List<String> x5c) Creates a RsaJWK.RsaJWK
(KeyUse use, String alg, String kid, String n, String e, String d, String x5u, String x5t, List<String> x5c) Creates a RsaJWK.RsaJWK
(KeyUse use, String alg, String kid, String n, String e, String x5u, String x5t, List<String> x5c) Creates a RsaJWK. -
Method Summary
Modifier and TypeMethodDescriptionGet 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.static RsaJWK
Parses a RsaJWK from a json string.static RsaJWK
Parses a RsaJWK from a jsonValue Object.Prints the RsaJWK object as a json string.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, getKeyId, getKeyType, getUse, getX509Chain, getX509Thumbnail, getX509URL, toJsonValue
Methods inherited from class org.forgerock.json.jose.jwt.JWObject
checkListValuesAreOfType, checkValueIsOfType, get, isDefined, isValueOfType, keys, put, toJsonValue, toString
-
Constructor Details
-
RsaJWK
public RsaJWK(KeyUse use, String alg, String kid, String n, String e, String x5u, String x5t, List<String> x5c) Creates a RsaJWK.- Parameters:
use
- the use of the JWKalg
- the alg of the JWKkid
- the key id of the JWKn
- the modulus of the JWKe
- 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
public RsaJWK(KeyUse use, String alg, String kid, String n, String e, String d, String x5u, String x5t, List<String> x5c) Creates a RsaJWK.- Parameters:
use
- the use of the JWKalg
- the alg of the JWKkid
- the key id of the JWKn
- the modulus of the JWKe
- the public exponent JWKd
- 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
public RsaJWK(KeyUse use, String alg, String kid, String n, String e, String p, String q, String dp, String dq, String qi, String x5u, String x5t, List<String> x5c) Creates a RsaJWK.- Parameters:
use
- the use of the JWKalg
- the alg of the JWKkid
- the key id of the JWKn
- the modulus of the JWKe
- the public exponent JWKp
- the first prime factor of the JWKq
- the second prime factor of the JWKdp
- the first factor exponent of the JWKdq
- the second factor exponent of the JWKqi
- 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
public RsaJWK(KeyUse use, String alg, String kid, String n, String e, String d, String p, String q, String dp, String dq, String qi, List<RsaJWK.OtherFactors> factors, String x5u, String x5t, List<String> x5c) Creates a RsaJWK.- Parameters:
use
- the use of the JWKalg
- the alg of the JWKkid
- the key id of the JWKn
- the modulus of the JWKe
- the public exponent JWKd
- the private exponent JWKp
- the first prime factor of the JWKq
- the second prime factor of the JWKdp
- the first factor exponent of the JWKdq
- the second factor exponent of the JWKqi
- the first CRT Coefficient of the JWKfactors
- 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
public RsaJWK(RSAPublicKey key, KeyUse use, String alg, String kid, String x5u, String x5t, List<String> x5c) Creates a RsaJWK.- Parameters:
use
- the use of the JWKalg
- the alg of the JWKkid
- the key id of the JWKkey
- the RSAPublicKey to usex5u
- the x509 url for the keyx5t
- the x509 thumbnail for the keyx5c
- the x509 chain as a list of Base64 encoded strings
-
RsaJWK
public RsaJWK(RSAPublicKey pubKey, RSAPrivateKey privKey, KeyUse use, String alg, String kid, String x5u, String x5t, List<String> x5c) Creates a RsaJWK.- Parameters:
use
- the use of the JWKalg
- the alg of the JWKkid
- the key id of the JWKpubKey
- the RSAPublicKey to useprivKey
- the RSAPrivateKey to usex5u
- the x509 url for the keyx5t
- the x509 thumbnail for the keyx5c
- the x509 chain as a list of Base64 encoded strings
-
RsaJWK
public RsaJWK(RSAPublicKey pubKey, RSAPrivateCrtKey privCert, KeyUse use, String alg, String kid, String x5u, String x5t, List<String> x5c) Creates a RsaJWK.- Parameters:
use
- the use of the JWKalg
- the alg of the JWKkid
- the key id of the JWKpubKey
- the RSAPublicKey to useprivCert
- the RSAPrivateCrtKey to usex5u
- the x509 url for the keyx5t
- the x509 thumbnail for the keyx5c
- the x509 chain as a list of Base64 encoded strings
-
-
Method Details
-
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
-
getOtherFactors
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
-
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
-
toJsonString
Prints the RsaJWK object as a json string.- Overrides:
toJsonString
in classJWK
- Returns:
- json string
-