Class StandardCryptoKeyPairUtility
java.lang.Object
dev.getelements.elements.service.util.StandardCryptoKeyPairUtility
- All Implemented Interfaces:
CryptoKeyPairUtility
-
Field Summary
Fields inherited from interface dev.getelements.elements.sdk.service.util.CryptoKeyPairUtility
ECDSA_ALGO, RSA_ALGO
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateKeyPair
(PrivateKeyCrytpoAlgorithm privateKeyCrytpoAlgorithm) Generates a key pair (public and private) as anEncodedKeyPair
.<PrivateKeyT extends PrivateKey>
PrivateKeyTgetPrivateKey
(PrivateKeyCrytpoAlgorithm privateKeyCrytpoAlgorithm, String base64Representation, Class<PrivateKeyT> publicKeyTClass) Loads the private key from the supplied base64 encoded string.<PublicKeyT extends PublicKey>
PublicKeyTgetPublicKey
(PrivateKeyCrytpoAlgorithm privateKeyCrytpoAlgorithm, String base64Representation, Class<PublicKeyT> publicKeyTClass) Loads the public key from the supplied base64 encoded string.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.getelements.elements.sdk.service.util.CryptoKeyPairUtility
getPrivateKey, getPublicKey
-
Constructor Details
-
StandardCryptoKeyPairUtility
- Throws:
NoSuchAlgorithmException
-
-
Method Details
-
generateKeyPair
Description copied from interface:CryptoKeyPairUtility
Generates a key pair (public and private) as anEncodedKeyPair
.- Specified by:
generateKeyPair
in interfaceCryptoKeyPairUtility
- Parameters:
privateKeyCrytpoAlgorithm
- thePrivateKeyCrytpoAlgorithm
to use.- Returns:
- the
EncodedKeyPair
including both public and private key.
-
getPublicKey
public <PublicKeyT extends PublicKey> PublicKeyT getPublicKey(PrivateKeyCrytpoAlgorithm privateKeyCrytpoAlgorithm, String base64Representation, Class<PublicKeyT> publicKeyTClass) Description copied from interface:CryptoKeyPairUtility
Loads the public key from the supplied base64 encoded string.- Specified by:
getPublicKey
in interfaceCryptoKeyPairUtility
- Type Parameters:
PublicKeyT
- the requested type- Parameters:
privateKeyCrytpoAlgorithm
- the auth scheme algorithmbase64Representation
- the base64 encoded public keypublicKeyTClass
- the public key class- Returns:
- the public key
-
getPrivateKey
public <PrivateKeyT extends PrivateKey> PrivateKeyT getPrivateKey(PrivateKeyCrytpoAlgorithm privateKeyCrytpoAlgorithm, String base64Representation, Class<PrivateKeyT> publicKeyTClass) Description copied from interface:CryptoKeyPairUtility
Loads the private key from the supplied base64 encoded string.- Specified by:
getPrivateKey
in interfaceCryptoKeyPairUtility
- Type Parameters:
PrivateKeyT
- the requested type- Parameters:
privateKeyCrytpoAlgorithm
- the auth scheme algorithmbase64Representation
- the base64 encoded public keypublicKeyTClass
- the public key class- Returns:
- the
PrivateKey
-