Module org.elasticsearch.xcore
Class CryptoService
java.lang.Object
org.elasticsearch.xpack.core.watcher.crypto.CryptoService
Service that provides cryptographic methods based on a shared system key
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddSettings(List<Setting<?>> settings) char[]decrypt(char[] chars) Decrypts the provided char array and returns the plain-text charschar[]encrypt(char[] chars) Encrypts the provided char array and returns the encrypted values in a char arrayprotected static booleanisEncrypted(char[] chars) Checks whether the given chars are encrypted
-
Field Details
-
KEY_ALGO
- See Also:
-
KEY_SIZE
public static final int KEY_SIZE- See Also:
-
ENCRYPTED_TEXT_PREFIX
- See Also:
-
-
Constructor Details
-
CryptoService
- Throws:
IOException
-
-
Method Details
-
encrypt
public char[] encrypt(char[] chars) Encrypts the provided char array and returns the encrypted values in a char array- Parameters:
chars- the characters to encrypt- Returns:
- character array representing the encrypted data
-
decrypt
public char[] decrypt(char[] chars) Decrypts the provided char array and returns the plain-text chars- Parameters:
chars- the data to decrypt- Returns:
- plaintext chars
-
isEncrypted
protected static boolean isEncrypted(char[] chars) Checks whether the given chars are encrypted- Parameters:
chars- the chars to check if they are encrypted- Returns:
- true is data is encrypted
-
addSettings
-