KeyManager

KeyManager is used for accessing system PublicKey's or generating a HMAC Key.

KeyManager Properties

SIGNATURE_ES256 JWA algorithm name for ECDSA using P-256 and SHA-256
SIGNATURE_ES384 JWA algorithm name for ECDSA using P-384 and SHA-384.
SIGNATURE_ES512 JWA algorithm name for ECDSA using P-512 and SHA-512.
SIGNATURE_HS256 JWA algorithm name for HMAC using SHA-256.
SIGNATURE_HS384 JWA algorithm name for HMAC using SHA-384.
SIGNATURE_HS512 JWA algorithm name for HMAC using SHA-512.
SIGNATURE_NONE JWA name for No digital signature or MAC performed
SIGNATURE_PS256 JWA algorithm name for RSASSA-PSS using SHA-256 and MGF1 with SHA-256.
SIGNATURE_PS384 JWA algorithm name for RSASSA-PSS using SHA-384 and MGF1 with SHA-384.
SIGNATURE_PS512 JWA algorithm name for RSASSA-PSS using SHA-512 and MGF1 with SHA-512.
SIGNATURE_RS256 JWA algorithm name for RSASSA-PKCS-v1_5 using SHA-256
SIGNATURE_RS384 JWA algorithm name for RSASSA-PKCS-v1_5 using SHA-384
SIGNATURE_RS512 JWA algorithm name for RSASSA-PKCS-v1_5 using SHA-512

KeyManager Functions

generateAESSecretKey KeyManager.generateAESSecretKey( secretKey ) Returns AES Secret key from the specified byte array
generateAESSecretKey KeyManager.generateAESSecretKey( secretKey ) Returns AES Secret key from the specified String
generateHMACSecretKey KeyManager.generateHMACSecretKey( signatureAlgorthm , secretKey ) Returns HMAC Secret Key based on the HMAC Algorithm
generateHMACSecretKey KeyManager.generateHMACSecretKey( signatureAlgorthm , secretKey ) Returns HMAC Secret Key based on the HMAC Algorithm
generateSecretKeyBytes KeyManager.generateSecretKeyBytes( size ) Returns random bytes of a specified length using {@code java.security.SecureRandom}
getKeyFromKeystore KeyManager.getKeyFromKeystore( alias , password ) Returns Key from the system key store for a given alias name and password.
getPublicKeyFromKeystore KeyManager.getPublicKeyFromKeystore( alias ) Returns a PublicKey from the system key store for a given alias name.
getPublicKeyFromRemoteCerts KeyManager.getPublicKeyFromRemoteCerts( certsURL , keyId ) Returns a PublicKey from a published published X509 base64 encoded certificates using the specified URL, identified by a keyId
getPublicKeyFromTrustore KeyManager.getPublicKeyFromTrustore( alias [, password ] ) Returns Key from the system key store for a given alias name and password.