public class JWK extends Object
The following JSON object members are common to all JWK types:
Example JSON object representation of a public RSA JWK:
{ "kty" : "RSA", "n" : "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx 4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMs tn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2 QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbI SD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqb w0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw", "e" : "AQAB", "alg" : "RS256", "kid" : "2011-04-29" }
Example JSON object representation of a public and private RSA JWK (with both the first and the second private key representations):
{ "kty" : "RSA", "n" : "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx 4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMs tn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2 QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbI SD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqb w0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw", "e" : "AQAB", "d" : "X4cTteJY_gn4FYPsXB8rdXix5vwsg1FLN5E3EaG6RJoVH-HLLKD9 M7dx5oo7GURknchnrRweUkC7hT5fJLM0WbFAKNLWY2vv7B6NqXSzUvxT0_YSfqij wp3RTzlBaCxWp4doFk5N2o8Gy_nHNKroADIkJ46pRUohsXywbReAdYaMwFs9tv8d _cPVY3i07a3t8MN6TNwm0dSawm9v47UiCl3Sk5ZiG7xojPLu4sbg1U2jx4IBTNBz nbJSzFHK66jT8bgkuqsk0GjskDJk19Z4qwjwbsnn4j2WBii3RL-Us2lGVkY8fkFz me1z0HbIkfz0Y6mqnOYtqc0X4jfcKoAC8Q", "p" : "83i-7IvMGXoMXCskv73TKr8637FiO7Z27zv8oj6pbWUQyLPQBQxtPV nwD20R-60eTDmD2ujnMt5PoqMrm8RfmNhVWDtjjMmCMjOpSXicFHj7XOuVIYQyqV WlWEh6dN36GVZYk93N8Bc9vY41xy8B9RzzOGVQzXvNEvn7O0nVbfs", "q" : "3dfOR9cuYq-0S-mkFLzgItgMEfFzB2q3hWehMuG0oCuqnb3vobLyum qjVZQO1dIrdwgTnCdpYzBcOfW5r370AFXjiWft_NGEiovonizhKpo9VVS78TzFgx kIdrecRezsZ-1kYd_s1qDbxtkDEgfAITAG9LUnADun4vIcb6yelxk", "dp" : "G4sPXkc6Ya9y8oJW9_ILj4xuppu0lzi_H7VTkS8xj5SdX3coE0oim YwxIi2emTAue0UOa5dpgFGyBJ4c8tQ2VF402XRugKDTP8akYhFo5tAA77Qe_Nmtu YZc3C3m3I24G2GvR5sSDxUyAN2zq8Lfn9EUms6rY3Ob8YeiKkTiBj0", "dq" : "s9lAH9fggBsoFR8Oac2R_E2gw282rT2kGOAhvIllETE1efrA6huUU vMfBcMpn8lqeW6vzznYY5SSQF7pMdC_agI3nG8Ibp1BUb0JUiraRNqUfLhcQb_d9 GF4Dh7e74WbRsobRonujTYN1xCaP6TO61jvWrX-L18txXw494Q_cgk", "qi" : "GyM_p6JrXySiz1toFgKbWV-JdI3jQ4ypu9rbMWx3rQJBfmt0FoYzg UIZEVFEcOqwemRN81zoDAaa-Bk0KWNGDjJHZDdDmFhW3AN7lI-puxk_mHZGJ11rx yR8O55XLSe3SPmRfKwZI6yU24ZxvQKFYItdldUKGzO6Ia6zTKhAVRU", "alg" : "RS256", "kid" : "2011-04-29" }
See RFC 3447.
See http://en.wikipedia.org/wiki/RSA_%28algorithm%29
Modifier | Constructor and Description |
---|---|
protected |
JWK(javax.json.JsonObject keyParameters)
Instantiates a new JWK.
|
Modifier and Type | Method and Description |
---|---|
String |
getCRTCoefficient()
Gets the The first Chinese Remainder Theorem coefficient of the private RSA key.
|
javax.json.JsonObject |
getJsonObject()
Gets the
JsonObject . |
String |
getKeyAlgorithm()
Gets the intended JOSE algorithm for the key, optional.
|
String |
getKeyIdentifier()
Gets the key identifier, optional.
|
List<String> |
getKeyOperations()
Gets the key operations, optional.
|
List<String> |
getKeyParameterValues(String name)
Gets the key parameter values.
|
String |
getKeyType()
Gets the key type, required.
|
String |
getKeyUse()
Gets the key use, optional.
|
String |
getModulus()
Gets the modulus value for the RSA key.
|
String |
getPrimeExponentP()
Gets the first factor Chinese Remainder Theorem exponent of the private RSA key.
|
String |
getPrimeExponentQ()
Gets the second factor Chinese Remainder Theorem exponent of the private RSA key.
|
String |
getPrimeP()
Gets the first prime factor of the private RSA key.
|
String |
getPrimeQ()
Gets second prime factor of the private RSA key.
|
String |
getPrivateExponent()
Gets the private exponent of the RSA key.
|
String |
getPublicExponent()
Gets the public exponent of the RSA key.
|
List<String> |
getX509CertificateChain()
Gets the x509 certificate chain.
|
String |
getX509SHA1CertificateThumbprint()
Gets the x509 SHA1 certificate thumbprint.
|
String |
getX509SHA256CertificateThumbprint()
Gets the x509 SHA256 certificate thumbprint.
|
String |
getX509Url()
Gets the x509 URL.
|
RSAPublicKey |
toRSAPublicKey()
Builds up the
RSAPublicKey using modulus and public exponent of RSA Key. |
String |
toString() |
protected JWK(javax.json.JsonObject keyParameters)
keyParameters
- the key parameterspublic String getKeyType()
public String getKeyUse()
public List<String> getKeyOperations()
public String getKeyAlgorithm()
public String getKeyIdentifier()
public String getX509Url()
public List<String> getX509CertificateChain()
public String getX509SHA1CertificateThumbprint()
public String getX509SHA256CertificateThumbprint()
public String getModulus()
public String getPublicExponent()
public String getPrivateExponent()
public String getPrimeP()
public String getPrimeQ()
public String getPrimeExponentP()
public String getPrimeExponentQ()
public String getCRTCoefficient()
public String toString()
toString
in class Object
Object.toString()
public List<String> getKeyParameterValues(String name)
name
- the namepublic RSAPublicKey toRSAPublicKey()
RSAPublicKey
using modulus and public exponent of RSA Key.public javax.json.JsonObject getJsonObject()
JsonObject
.Copyright © 2014. All rights reserved.