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, waitMethods inherited from interface dev.getelements.elements.sdk.service.util.CryptoKeyPairUtility
getPrivateKey, getPublicKey
-
Constructor Details
-
StandardCryptoKeyPairUtility
- Throws:
NoSuchAlgorithmException
-
-
Method Details
-
generateKeyPair
Description copied from interface:CryptoKeyPairUtilityGenerates a key pair (public and private) as anEncodedKeyPair.- Specified by:
generateKeyPairin interfaceCryptoKeyPairUtility- Parameters:
privateKeyCrytpoAlgorithm- thePrivateKeyCrytpoAlgorithmto use.- Returns:
- the
EncodedKeyPairincluding both public and private key.
-
getPublicKey
public <PublicKeyT extends PublicKey> PublicKeyT getPublicKey(PrivateKeyCrytpoAlgorithm privateKeyCrytpoAlgorithm, String base64Representation, Class<PublicKeyT> publicKeyTClass) Description copied from interface:CryptoKeyPairUtilityLoads the public key from the supplied base64 encoded string.- Specified by:
getPublicKeyin 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:CryptoKeyPairUtilityLoads the private key from the supplied base64 encoded string.- Specified by:
getPrivateKeyin 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
-