Class NoopKeyReferenceCryptoService
java.lang.Object
ch.admin.bit.jeap.crypto.internal.core.noop.NoopKeyReferenceCryptoService
- All Implemented Interfaces:
KeyReferenceCryptoService
Should only be used to bypass encryption and decryption in dev environments. Hence, plaintext and ciphertext are
returned untouched. No encryption or decryption is performed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDecrypt(byte[] ciphertext) byte[]decrypt(byte[] ciphertextCryptoContainer) Decrypts a jEAP crypto container back to the plaintext bytes.byte[]encrypt(byte[] plaintext, KeyReference wrappingKeyReference) Encrypts plaintext to a jEAP crypto container, using a data key for encryption of the data.
-
Constructor Details
-
NoopKeyReferenceCryptoService
public NoopKeyReferenceCryptoService()
-
-
Method Details
-
encrypt
Description copied from interface:KeyReferenceCryptoServiceEncrypts plaintext to a jEAP crypto container, using a data key for encryption of the data.- Specified by:
encryptin interfaceKeyReferenceCryptoService- Parameters:
plaintext- Plaintext bytes to be encryptedwrappingKeyReference- Reference to a key managed by aKeyManagementService, which is used for generating data keys- Returns:
- Encrypted data container, formatted according to a
JeapCryptoDataFormat
-
decrypt
public byte[] decrypt(byte[] ciphertextCryptoContainer) Description copied from interface:KeyReferenceCryptoServiceDecrypts a jEAP crypto container back to the plaintext bytes. The crypto container must contain a reference to the data key's wrapping key, i.e. key name/location.- Specified by:
decryptin interfaceKeyReferenceCryptoService- Parameters:
ciphertextCryptoContainer- Encrypted data container, formatted according to aJeapCryptoDataFormat- Returns:
- Decrypted plaintext bytes
-
canDecrypt
public boolean canDecrypt(byte[] ciphertext) - Specified by:
canDecryptin interfaceKeyReferenceCryptoService
-