- java.lang.Object
-
- io.helidon.security.jwt.jwk.Jwk
-
- io.helidon.security.jwt.jwk.JwkRSA
-
public class JwkRSA extends Jwk
RSA JSON web key.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JwkRSA.Builder
Builder forJwkRSA
.
-
Field Summary
Fields Modifier and Type Field Description static String
ALG_RS256
RSASSA-PKCS1-v1_5 using SHA-256.static String
ALG_RS384
RSASSA-PKCS1-v1_5 using SHA-384.static String
ALG_RS512
RSASSA-PKCS1-v1_5 using SHA-512.static String
PARAM_EXP
JWK parameter for private key exponent.static String
PARAM_FIRST_CRT_COEFF
JWK parameter for private key First CRT Coefficient.static String
PARAM_FIRST_FACTOR_CRT_EXP
JWK parameter for private key First Factor CRT Exponent.static String
PARAM_FIRST_PRIME_FACTOR
JWK parameter for private key First Prime Factor.static String
PARAM_OTHER_PRIMES
JWK parameter for private key Other Primes Info.static String
PARAM_PUB_EXP
JWK parameter for public key exponent.static String
PARAM_PUB_MODULUS
JWK parameter for public key modulus.static String
PARAM_SECOND_FACTOR_CRT_EXP
JWK parameter for private key Second Factor CRT Exponent.static String
PARAM_SECOND_PRIME_FACTOR
JWK parameter for private key Second Prime Factor.static String
PARAM_X509_CHAIN
JWK parameter for X.509 certificate chain array.static String
PARAM_X509_CHAIN_URL
JWK parameter for X.509 certificate chain URL.static String
PARAM_X509_SHA_1
JWK parameter for SHA 1 Thumbprint of X.509 certificate.static String
PARAM_X509_SHA_256
JWK parameter for SHA 256 Thumbprint of X.509 certificate.static String
SECURITY_ALGORITHM
The main Java security algorithm used.-
Fields inherited from class io.helidon.security.jwt.jwk.Jwk
ALG_NONE, KEY_TYPE_EC, KEY_TYPE_OCT, KEY_TYPE_RSA, NONE_JWK, OPERATION_DECRYPT, OPERATION_DERIVE_BITS, OPERATION_DERIVE_KEY, OPERATION_ENCRYPT, OPERATION_SIGN, OPERATION_UNWRAP_KEY, OPERATION_VERIFY, OPERATION_WRAP_KEY, PARAM_ALGORITHM, PARAM_KEY_ID, PARAM_KEY_TYPE, PARAM_OPERATIONS, PARAM_USE, USE_ENCRYPTION, USE_SIGNATURE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JwkRSA.Builder
builder()
Create a builder instance.Optional<List<X509Certificate>>
certificateChain()
static JwkRSA
create(JsonObject json)
Create an instance from Json object.byte[]
doSign(byte[] bytesToSign)
boolean
doVerify(byte[] signedBytes, byte[] signatureToVerify)
Optional<PrivateKey>
privateKey()
PublicKey
publicKey()
Optional<byte[]>
sha1Thumbprint()
Optional<byte[]>
sha256Thumbprint()
-
Methods inherited from class io.helidon.security.jwt.jwk.Jwk
algorithm, keyId, keyType, operations, sign, toString, usage, verifySignature
-
-
-
-
Field Detail
-
SECURITY_ALGORITHM
public static final String SECURITY_ALGORITHM
The main Java security algorithm used.- See Also:
- Constant Field Values
-
ALG_RS256
public static final String ALG_RS256
RSASSA-PKCS1-v1_5 using SHA-256. See RFC 7518, section 7.1.2.- See Also:
- Constant Field Values
-
ALG_RS384
public static final String ALG_RS384
RSASSA-PKCS1-v1_5 using SHA-384. See RFC 7518, section 7.1.2.- See Also:
- Constant Field Values
-
ALG_RS512
public static final String ALG_RS512
RSASSA-PKCS1-v1_5 using SHA-512. See RFC 7518, section 7.1.2.- See Also:
- Constant Field Values
-
PARAM_PUB_MODULUS
public static final String PARAM_PUB_MODULUS
JWK parameter for public key modulus. See RFC 7518, section 6.3.1.1.- See Also:
- Constant Field Values
-
PARAM_PUB_EXP
public static final String PARAM_PUB_EXP
JWK parameter for public key exponent. See RFC 7518, section 6.3.1.2.- See Also:
- Constant Field Values
-
PARAM_EXP
public static final String PARAM_EXP
JWK parameter for private key exponent. See RFC 7518, section 6.3.2.1.- See Also:
- Constant Field Values
-
PARAM_FIRST_PRIME_FACTOR
public static final String PARAM_FIRST_PRIME_FACTOR
JWK parameter for private key First Prime Factor. See RFC 7518, section 6.3.2.2.- See Also:
- Constant Field Values
-
PARAM_SECOND_PRIME_FACTOR
public static final String PARAM_SECOND_PRIME_FACTOR
JWK parameter for private key Second Prime Factor. See RFC 7518, section 6.3.2.3.- See Also:
- Constant Field Values
-
PARAM_FIRST_FACTOR_CRT_EXP
public static final String PARAM_FIRST_FACTOR_CRT_EXP
JWK parameter for private key First Factor CRT Exponent. See RFC 7518, section 6.3.2.4.- See Also:
- Constant Field Values
-
PARAM_SECOND_FACTOR_CRT_EXP
public static final String PARAM_SECOND_FACTOR_CRT_EXP
JWK parameter for private key Second Factor CRT Exponent. See RFC 7518, section 6.3.2.5.- See Also:
- Constant Field Values
-
PARAM_FIRST_CRT_COEFF
public static final String PARAM_FIRST_CRT_COEFF
JWK parameter for private key First CRT Coefficient. See RFC 7518, section 6.3.2.6.- See Also:
- Constant Field Values
-
PARAM_OTHER_PRIMES
public static final String PARAM_OTHER_PRIMES
JWK parameter for private key Other Primes Info. See RFC 7518, section 6.3.2.7.- See Also:
- Constant Field Values
-
PARAM_X509_CHAIN_URL
public static final String PARAM_X509_CHAIN_URL
JWK parameter for X.509 certificate chain URL. See RFC 7517, section 4.6.- See Also:
- Constant Field Values
-
PARAM_X509_CHAIN
public static final String PARAM_X509_CHAIN
JWK parameter for X.509 certificate chain array. See RFC 7517, section 4.7.- See Also:
- Constant Field Values
-
PARAM_X509_SHA_1
public static final String PARAM_X509_SHA_1
JWK parameter for SHA 1 Thumbprint of X.509 certificate. See RFC 7517, section 4.8.- See Also:
- Constant Field Values
-
PARAM_X509_SHA_256
public static final String PARAM_X509_SHA_256
JWK parameter for SHA 256 Thumbprint of X.509 certificate. See RFC 7517, section 4.9.- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
public static JwkRSA.Builder builder()
Create a builder instance.- Returns:
- builder ready to create a new
JwkRSA
instance.
-
create
public static JwkRSA create(JsonObject json)
Create an instance from Json object.- Parameters:
json
- with definition of this RSA web key- Returns:
- new instance of this class constructed from json
- See Also:
for generic method that can load any supported JWK type.
-
privateKey
public Optional<PrivateKey> privateKey()
-
publicKey
public PublicKey publicKey()
-
certificateChain
public Optional<List<X509Certificate>> certificateChain()
-
sha1Thumbprint
public Optional<byte[]> sha1Thumbprint()
-
sha256Thumbprint
public Optional<byte[]> sha256Thumbprint()
-
doVerify
public boolean doVerify(byte[] signedBytes, byte[] signatureToVerify)
-
doSign
public byte[] doSign(byte[] bytesToSign)
-
-