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>
public static class EncryptionProvider.EncryptionSupport extends Object
Encryption support created for each named encryption configuration.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EncryptionProvider.EncryptionSupport
create(Function<byte[],Single<String>> encryptionFunction, Function<String,Single<byte[]>> decryptionFunction)
Create a new support based on encrypt and decrypt functions.Single<byte[]>
decrypt(String encrypted)
Decrypt the bytes.Single<String>
encrypt(byte[] bytes)
Encrypt the bytes.
-
-
-
Constructor Detail
-
EncryptionSupport
protected EncryptionSupport(Function<byte[],Single<String>> encryptionFunction, Function<String,Single<byte[]>> decryptionFunction)
Encryption support based on the two functions.- Parameters:
encryptionFunction
- encrypts the provided bytes into cipher textdecryptionFunction
- decrypts cipher text into bytes
-
-
Method Detail
-
create
public static EncryptionProvider.EncryptionSupport create(Function<byte[],Single<String>> encryptionFunction, Function<String,Single<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
public Single<String> encrypt(byte[] bytes)
Encrypt the bytes.- Parameters:
bytes
- bytes to encrypt- Returns:
- future with the encrypted cipher text
-
-