Module io.helidon.security
Package io.helidon.security.spi
Class EncryptionProvider.EncryptionSupport
java.lang.Object
io.helidon.security.spi.EncryptionProvider.EncryptionSupport
- Enclosing interface:
EncryptionProvider<T extends ProviderConfig>
Encryption support created for each named encryption configuration.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEncryptionSupport(Function<byte[], String> encryptionFunction, Function<String, byte[]> decryptionFunction) Encryption support based on the two functions. -
Method Summary
Modifier and TypeMethodDescriptionCreate a new support based on encrypt and decrypt functions.byte[]Decrypt the bytes.encrypt(byte[] bytes) Encrypt the bytes.
-
Constructor Details
-
EncryptionSupport
protected EncryptionSupport(Function<byte[], String> encryptionFunction, Function<String, byte[]> decryptionFunction) Encryption support based on the two functions.- Parameters:
encryptionFunction- encrypts the provided bytes into cipher textdecryptionFunction- decrypts cipher text into bytes
-
-
Method Details
-
create
public static EncryptionProvider.EncryptionSupport create(Function<byte[], String> encryptionFunction, Function<String, byte[]> decryptionFunction) Create a new support based on encrypt and decrypt functions.- Parameters:
encryptionFunction- encrypts the provided bytes into cipher textdecryptionFunction- decrypts cipher text into bytes- Returns:
- new encryption support
-
encrypt
Encrypt the bytes.- Parameters:
bytes- bytes to encrypt- Returns:
- future with the encrypted cipher text
-
decrypt
Decrypt the bytes.- Parameters:
encrypted- cipher text- Returns:
- future with the decrypted bytes
-