Package ch.admin.bit.jeap.crypto.api
Interface CryptoService
- All Known Implementing Classes:
NoopCryptoService
public interface CryptoService
-
Method Summary
-
Method Details
-
encrypt
byte[] encrypt(byte[] plaintext) Encrypts plaintext to a jEAP crypto container, using a data key for encryption of the data.- Parameters:
plaintext- Plaintext bytes to be encrypted- Returns:
- Encrypted data container, formatted according to a
JeapCryptoDataFormat - Throws:
CryptoException- If encryption fails for any reason (empty plaintext, bad configuration, unable to get data key, ...)
-
decrypt
byte[] decrypt(byte[] ciphertextCryptoContainer) Decrypts a jEAP crypto container back to the plaintext bytes.- Parameters:
ciphertextCryptoContainer- Encrypted data container, formatted according to aJeapCryptoDataFormat- Returns:
- Decrypted plaintext bytes
- Throws:
CryptoException- If decryption fails for any reason (bad configuration, unable to decrypt data key, ...)
-