public class RSASignedTokenCreator extends java.lang.Object implements TokenCreator
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ALGORITHM_RSA
Cryptographic algorithm name.
|
private static java.lang.String |
KEYSTORAGE_PASSWORD
Key store password.
|
private static java.lang.String |
KEYSTORAGE_PATH
Path to key storage with RSA keys.
|
private static java.lang.String |
KEYSTORE_TYPE
Keystore type.
|
private static java.lang.String |
PREFIX
Prefix for parameters configured in a properties file.
|
private static java.lang.String |
PRIVATE_KEY_ALIAS
Alias for private RSA key.
|
private static java.lang.String |
PRIVATE_KEY_PASSWORD
Password for private RSA key.
|
private java.security.interfaces.RSAPrivateKey |
privateKey
Private key used for token creation.
|
private static java.lang.String |
PUBLIC_KEY_ALIAS
Alias for public RSA key.
|
private static java.lang.String |
PUBLIC_KEY_PASSWORD
Password for public RSA key.
|
private java.security.interfaces.RSAPublicKey |
publicKey
Public key used for token parsing.
|
Constructor and Description |
---|
RSASignedTokenCreator() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
create(JWTClaimsSet claimsSet)
Creates token value.
|
private java.security.KeyStore |
getKeyStore(java.io.InputStream is,
Obtains key store.
|
private static java.security.interfaces.RSAPublicKey |
getRSAPublicKey(java.security.interfaces.RSAPrivateKey key)
Try to generate RSA public key according a particular RSA private key.
|
void |
init(java.util.Properties parameters)
Initializes token verifier instance.
|
private void |
initRSAPrivateKey(java.security.KeyStore ks,
Initialize RSA public key.
|
private void |
initRSAPublicKey(java.security.KeyStore keyStorage,
Initialize RSA public key.
|
JWTClaimsSet |
parse(java.lang.String token)
Parse secured form of JWT token to JWTClaimsSet instance.
|
init
in interface TokenCreator
parameters
- Parameters for the token verifier instance.TokenCreator.init(java.util.Properties)
create
in interface TokenCreator
claimsSet
- Claims set to be used for token creation.cz.ues.platform.security.uutoken.internal.TokenCreator#create(com.nimbusds.jwt.JWTClaimsSet)
parse
in interface TokenCreator
token
- Value to be parsed.TokenCreator.parse(java.lang.String)
is
- Input stream for the key store.keyStorePassword
- Key storage password.keyStorage
- Key storage.alias
- RSA public key alias.password
- Password for the RSA public key used in the key storage.keyStorage
- Key storage.alias
- RSA public key alias.password
- Password for the RSA public key used in the key storage.key
- RSA private key.null
otherwise.