Class EncryptedFileKey
java.lang.Object
com.exceptionfactory.jagged.framework.crypto.EncryptedFileKey
- All Implemented Interfaces:
Serializable,Key,SecretKey,Destroyable
File Key extension of Cryptographic Algorithm Key encrypted with ChaCha20-Poly1305
- See Also:
-
Field Summary
Fields inherited from interface javax.crypto.SecretKey
serialVersionUID -
Constructor Summary
ConstructorsConstructorDescriptionEncryptedFileKey(byte[] key) Encrypted File Key constructor with required key byte array -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroy Key so that it cannot be used for subsequent operationsGet Cryptographic Algorithm for which the key will be usedbyte[]Get encoded key bytesGet Key format returns RAW indicating encoded key contains raw bytesbooleanReturn destroyed status
-
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
Get Cryptographic Algorithm for which the key will be used- Specified by:
getAlgorithmin interfaceKey- Returns:
- Cryptographic Algorithm
-
getFormat
Get Key format returns RAW indicating encoded key contains raw bytes -
getEncoded
public byte[] getEncoded()Get encoded key bytes- Specified by:
getEncodedin interfaceKey- Returns:
- Encoded Key byte array
-
destroy
public void destroy()Destroy Key so that it cannot be used for subsequent operations- Specified by:
destroyin interfaceDestroyable
-
isDestroyed
public boolean isDestroyed()Return destroyed status- Specified by:
isDestroyedin interfaceDestroyable- Returns:
- Key destroyed status
-