Interface CryptoService

All Known Implementing Classes:
NoopCryptoService

public interface CryptoService
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    decrypt(byte[] ciphertextCryptoContainer)
    Decrypts a jEAP crypto container back to the plaintext bytes.
    byte[]
    encrypt(byte[] plaintext)
    Encrypts plaintext to a jEAP crypto container, using a data key for encryption of the data.
  • 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 a JeapCryptoDataFormat
      Returns:
      Decrypted plaintext bytes
      Throws:
      CryptoException - If decryption fails for any reason (bad configuration, unable to decrypt data key, ...)