public class RSAUtils extends Object
| Constructor and Description |
|---|
RSAUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
generateJWS_x5t(byte[] derEncodedCertificate)
Generate the
x5t - the X.509 certificate thumbprint to be used in JWT header. |
static String |
generateJWS_x5t(String encodedCertificate)
Generate the
x5t - the X.509 certificate thumbprint to be used in JWT header. |
static String |
generateJWS_x5t(String algorithm,
byte[] derEncodedCertificate)
Generate the
x5t - the X.509 certificate thumbprint to be used in JWT header. |
static String |
generateJWS_x5t(String algorithm,
String encodedCertificate)
Generate the
x5t - the X.509 certificate thumbprint to be used in JWT header. |
static String |
getPEMFromPrivateKey(PrivateKey privateKey)
Return the private key in a PEM formatted String.
|
static String |
getPEMFromPublicKey(PublicKey publicKey)
Return the public key in a PEM formatted String.
|
static RSAPrivateKey |
getPrivateKeyFromPEM(String privateKey)
Return a Private Key from the provided private key in PEM format.
|
static RSAPublicKey |
getPublicKeyFromPEM(String publicKey)
Return a PublicKey from the public key pem string.
|
public static String generateJWS_x5t(String algorithm, String encodedCertificate)
x5t - the X.509 certificate thumbprint to be used in JWT header.algorithm - the algorithm used to calculate the hash, generally SHA-1 or SHA-256.encodedCertificate - the Base64 encoded certificatepublic static String generateJWS_x5t(String encodedCertificate)
x5t - the X.509 certificate thumbprint to be used in JWT header.encodedCertificate - the Base64 encoded certificatepublic static String generateJWS_x5t(String algorithm, byte[] derEncodedCertificate)
x5t - the X.509 certificate thumbprint to be used in JWT header.algorithm - the algorithm used to calculate the hash, generally SHA-1 or SHA-256.derEncodedCertificate - the DER encoded certificatepublic static String generateJWS_x5t(byte[] derEncodedCertificate)
x5t - the X.509 certificate thumbprint to be used in JWT header.derEncodedCertificate - the DER encoded certificatepublic static String getPEMFromPrivateKey(PrivateKey privateKey)
privateKey - The private key.public static String getPEMFromPublicKey(PublicKey publicKey)
publicKey - The publicKey key.public static RSAPrivateKey getPrivateKeyFromPEM(String privateKey)
privateKey - the private key in string format.public static RSAPublicKey getPublicKeyFromPEM(String publicKey)
publicKey - the public in PEM format.Copyright © 2017. All rights reserved.