Class StandardWalletCryptoUtilities
java.lang.Object
dev.getelements.elements.sdk.service.blockchain.crypto.StandardWalletCryptoUtilities
- All Implemented Interfaces:
WalletCryptoUtilities
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDecrypts the wallet.decrypt
(VaultKey unencryptedVaultKey, WalletAccount encryptedWalletAccount) Decrypts the wallet.Encrypts theWallet
.com.fasterxml.jackson.databind.ObjectMapper
jakarta.validation.Validator
void
setCipherUtility
(CipherUtility cipherUtility) void
setCryptoKeyPairUtility
(CryptoKeyPairUtility cryptoKeyPairUtility) void
setObjectMapper
(com.fasterxml.jackson.databind.ObjectMapper objectMapper) void
setValidator
(jakarta.validation.Validator validator)
-
Constructor Details
-
StandardWalletCryptoUtilities
public StandardWalletCryptoUtilities()
-
-
Method Details
-
encrypt
Description copied from interface:WalletCryptoUtilities
Encrypts theWallet
. If anyWalletAccount
whoseWalletAccount.isEncrypted()
flag is set to true, this method will throw an exception.- Specified by:
encrypt
in interfaceWalletCryptoUtilities
- Parameters:
wallet
- the wallet contents itself- Returns:
- a
Wallet
instance encry
-
decrypt
Description copied from interface:WalletCryptoUtilities
Decrypts the wallet. If decryption fails, such as for bad passphrase, then the method will returnOptional.empty()
- Specified by:
decrypt
in interfaceWalletCryptoUtilities
- Parameters:
unencryptedVaultKey
-wallet
- theWallet
- Returns:
- the
Optional<Wallet>
-
decrypt
public Optional<WalletAccount> decrypt(VaultKey unencryptedVaultKey, WalletAccount encryptedWalletAccount) Description copied from interface:WalletCryptoUtilities
Decrypts the wallet. If decryption fails, such as for bad passphrase, then the method will returnOptional.empty()
- Specified by:
decrypt
in interfaceWalletCryptoUtilities
- Parameters:
unencryptedVaultKey
-encryptedWalletAccount
- theWalletAccount
- Returns:
- the
Optional<Wallet>
-
getValidator
public jakarta.validation.Validator getValidator() -
setValidator
@Inject public void setValidator(jakarta.validation.Validator validator) -
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
setObjectMapper
@Inject public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
getCipherUtility
-
setCipherUtility
-
getCryptoKeyPairUtility
-
setCryptoKeyPairUtility
-