Class CryptoSupport
- java.lang.Object
-
- io.wcm.devops.conga.plugins.aem.crypto.CryptoSupport
-
- All Implemented Interfaces:
CryptoKeySupport
public abstract class CryptoSupport extends Object implements CryptoKeySupport
Support for symmetric encryption and decryption of data.
-
-
Constructor Summary
Constructors Constructor Description CryptoSupport()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract byte[]
decrypt(byte[] data, Key key)
Decrypt binary data with the given eky.String
decrypt(String cryptoString, Key key)
Decrypt binary data with the given eky.abstract byte[]
encrypt(byte[] data, Key key)
Encrypt binary data with the given key.String
encrypt(String plainText, Key key)
Encrypt plain text with the given key.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.wcm.devops.conga.plugins.aem.crypto.CryptoKeySupport
generateKey, readKey
-
-
-
-
Method Detail
-
encrypt
public abstract byte[] encrypt(byte[] data, Key key) throws GeneralSecurityException
Encrypt binary data with the given key.- Parameters:
data
- Data to be encryptedkey
- Crypto key- Returns:
- Encrypted data
- Throws:
GeneralSecurityException
- Security exception
-
decrypt
public abstract byte[] decrypt(byte[] data, Key key) throws GeneralSecurityException
Decrypt binary data with the given eky.- Parameters:
data
- Data to be decryptedkey
- Crypto key- Returns:
- Decrypted data
- Throws:
GeneralSecurityException
- Security exception
-
encrypt
public final String encrypt(String plainText, Key key) throws GeneralSecurityException
Encrypt plain text with the given key.- Parameters:
plainText
- Text to be encryptedkey
- Crypto key- Returns:
- Encrypted data as crypto string
- Throws:
GeneralSecurityException
- Security exception
-
decrypt
public final String decrypt(String cryptoString, Key key) throws GeneralSecurityException
Decrypt binary data with the given eky.- Parameters:
cryptoString
- Encrypted data as crypto stringkey
- Crypto key- Returns:
- Decrypted text
- Throws:
GeneralSecurityException
- Security exception
-
-