T
- the generic typeB
- the generic typepublic class JWKBuilder<T extends JWK,B extends JWKBuilder<?,?>> extends Object
The following JSON object members are common to all JWK types:
Modifier | Constructor and Description |
---|---|
|
JWKBuilder()
Instantiates a new JWK builder.
|
protected |
JWKBuilder(Class<T> tokenType)
Instantiates a new JWK builder.
|
Modifier and Type | Method and Description |
---|---|
T |
build()
Builds
JsonObjectBuilder of key parameters. |
protected T |
build(javax.json.JsonObject keyParametersObject)
Builds the key
JsonObject . |
T |
build(String json)
Builds the String JSON.
|
JWKBuilder<T,B> |
crtCoefficient(BigInteger crtCoefficient)
Sets the The first Chinese Remainder Theorem coefficient of the private RSA key.
|
protected javax.json.JsonObjectBuilder |
getkeyParametersBuilder()
Gets the key parameters builder.
|
protected Class<T> |
getTokenType()
Gets token type.
|
JWKBuilder<T,B> |
keyAlgorithm(String algorithm)
The alg (algorithm) member identifies the algorithm intended for use with the key.
|
JWKBuilder<T,B> |
keyIdentifier(String identifier)
The kid (key ID) member can be used to match a specific key.
|
JWKBuilder<T,B> |
keyOperations(String... keyOperations)
The key_ops (key operations) member identifies the operation(s) that the key is intended to be used for.
|
JWKBuilder<T,B> |
keyParameter(String name,
String... value)
Sets the Key parameter.
|
JWKBuilder<T,B> |
keyType(String type)
The kty (key type) member identifies the cryptographic algorithm family used with the key.
|
JWKBuilder<T,B> |
keyUse(String use)
The use (public key use) member identifies the intended use of the public key.
|
JWKBuilder<T,B> |
modulus(BigInteger modulus)
Sets the modulus value for the RSA key.
|
JWKBuilder<T,B> |
primeExponentP(BigInteger primeExponentP)
Sets the first factor Chinese Remainder Theorem exponent of the private RSA key.
|
JWKBuilder<T,B> |
primeExponentQ(BigInteger primeExponentQ)
Sets the second factor Chinese Remainder Theorem exponent of the private RSA key.
|
JWKBuilder<T,B> |
primeP(BigInteger primeP)
Sets the first prime factor of the private RSA key.
|
JWKBuilder<T,B> |
primeQ(BigInteger primeQ)
Sets second prime factor of the private RSA key.
|
JWKBuilder<T,B> |
privateExponent(BigInteger privateExponent)
Sets the private exponent of the RSA key.
|
JWKBuilder<T,B> |
publicExponent(BigInteger publicExponent)
Sets the public exponent of the RSA key.
|
JWKBuilder<T,B> |
X509CertificateChain(String... X509CertificateChain)
The x5c (X.509 Certificate Chain) member contains a chain of one or more PKIX certificates [RFC5280].
|
JWKBuilder<T,B> |
X509CertificateSHA1Thumbprint(String sha1Thumbprint)
The x5t (X.509 Certificate SHA-1 Thumbprint) member is a base64url encoded SHA-1 thumbprint (a.k.a.
|
JWKBuilder<T,B> |
X509CertificateSHA256Thumbprint(String sha256Thumbprint)
The x5t#S256 (X.509 Certificate SHA-256 Thumbprint) member is a base64url encoded SHA-256 thumbprint (a.k.a.
|
JWKBuilder<T,B> |
X509Url(String url)
The x5u (X.509 URL) member is a URI [RFC3986] that refers to a resource for an X.509 public key certificate or
certificate chain [RFC5280].
|
protected javax.json.JsonObjectBuilder getkeyParametersBuilder()
public JWKBuilder<T,B> keyType(String type)
type
- public JWKBuilder<T,B> keyUse(String use)
use
- the key usepublic JWKBuilder<T,B> keyOperations(String... keyOperations)
Other values MAY be used. Key operation values can be registered in the IANA JSON Web Key Operations registry defined in Section 8.3. The key operation values are case-sensitive strings. Duplicate key operation values MUST NOT be present in the array.
Multiple unrelated key operations SHOULD NOT be specified for a key because of the potential vulnerabilities associated with using the same key with multiple algorithms. Thus, the combinations sign with verify, encrypt with decrypt, and wrapKey with unwrapKey are permitted, but other combinations SHOULD NOT be used.The use and key_ops JWK members SHOULD NOT be used together.
keyOperations
- the key operationspublic JWKBuilder<T,B> keyAlgorithm(String algorithm)
algorithm
- the algorithmpublic JWKBuilder<T,B> keyIdentifier(String identifier)
When used with JWS or JWE, the kid value is used to match a JWS or JWE kid Header Parameter value.
identifier
- the identifierpublic JWKBuilder<T,B> X509Url(String url)
url
- the urlpublic JWKBuilder<T,B> X509CertificateChain(String... X509CertificateChain)
X509CertificateChain
- the x509 certificate chainpublic JWKBuilder<T,B> X509CertificateSHA1Thumbprint(String sha1Thumbprint)
sha1Thumbprint
- the SHA1 thumbprintpublic JWKBuilder<T,B> X509CertificateSHA256Thumbprint(String sha256Thumbprint)
sha256Thumbprint
- the SHA256 thumbprintpublic JWKBuilder<T,B> modulus(BigInteger modulus)
modulus
- the moduluspublic JWKBuilder<T,B> publicExponent(BigInteger publicExponent)
publicExponent
- the public exponentpublic JWKBuilder<T,B> privateExponent(BigInteger privateExponent)
privateExponent
- the private exponentpublic JWKBuilder<T,B> primeP(BigInteger primeP)
primeP
- the prime ppublic JWKBuilder<T,B> primeQ(BigInteger primeQ)
primeQ
- the prime qpublic JWKBuilder<T,B> primeExponentP(BigInteger primeExponentP)
primeExponentP
- the prime exponent ppublic JWKBuilder<T,B> primeExponentQ(BigInteger primeExponentQ)
primeExponentQ
- the prime exponent qpublic JWKBuilder<T,B> crtCoefficient(BigInteger crtCoefficient)
crtCoefficient
- the CRT coefficientpublic JWKBuilder<T,B> keyParameter(String name, String... value)
name
- the name of key parametervalue
- the value(s) of key parameterpublic T build()
JsonObjectBuilder
of key parameters.public T build(String json)
json
- the JSON formatted stringprotected T build(javax.json.JsonObject keyParametersObject)
JsonObject
.keyParametersObject
- the key parameters objectCopyright © 2015. All rights reserved.