Class EncryptedFileKey

java.lang.Object
com.exceptionfactory.jagged.framework.crypto.EncryptedFileKey
All Implemented Interfaces:
Serializable, Key, SecretKey, Destroyable

public final class EncryptedFileKey extends Object
File Key extension of Cryptographic Algorithm Key encrypted with ChaCha20-Poly1305
See Also:
  • Constructor Details

    • EncryptedFileKey

      public EncryptedFileKey(byte[] key)
      Encrypted File Key constructor with required key byte array
      Parameters:
      key - Encrypted Key consisting of 32 bytes
  • Method Details

    • getAlgorithm

      public String getAlgorithm()
      Get Cryptographic Algorithm for which the key will be used
      Specified by:
      getAlgorithm in interface Key
      Returns:
      Cryptographic Algorithm
    • getFormat

      public String getFormat()
      Get Key format returns RAW indicating encoded key contains raw bytes
      Specified by:
      getFormat in interface Key
      Returns:
      Format name of RAW
    • getEncoded

      public byte[] getEncoded()
      Get encoded key bytes
      Specified by:
      getEncoded in interface Key
      Returns:
      Encoded Key byte array
    • destroy

      public void destroy()
      Destroy Key so that it cannot be used for subsequent operations
      Specified by:
      destroy in interface Destroyable
    • isDestroyed

      public boolean isDestroyed()
      Return destroyed status
      Specified by:
      isDestroyed in interface Destroyable
      Returns:
      Key destroyed status