Package sonia.scm.security
Interface CipherHandler
- All Known Implementing Classes:
DefaultCipherHandler
public interface CipherHandler
Encrypts and decrypts string values.
- Since:
- 1.7
-
Method Summary
-
Method Details
-
decode
Decrypts the given value. -
decode
default byte[] decode(byte[] value) Decrypts the given value. If not implemented explicitly, this creates a string from the byte array, decodes this withdecode(String)
, and interprets this string as base 64 encoded byte array.if
encode(byte[])
is overridden by an implementation, this has to be implemented accordingly.- Parameters:
value
- encrypted value- Returns:
- decrypted value
-
encode
Encrypts the given value. -
encode
default byte[] encode(byte[] value) Encrypts the given value. If not implemented explicitly, this encoded the given byte array as a base 64 string, encodes this string withencode(String)
, and returns the bytes of this resulting string.if
decode(byte[])
is overridden by an implementation, this has to be implemented accordingly.- Parameters:
value
- plain byte array to encrypt.- Returns:
- encrypted value
-