Class PayloadNonceKey
java.lang.Object
com.exceptionfactory.jagged.framework.crypto.MacKey
com.exceptionfactory.jagged.framework.crypto.PayloadNonceKey
- All Implemented Interfaces:
Serializable,Key,SecretKey,Destroyable
Payload nonce consisting of 16 bytes from a cryptographically secure pseudorandom number generator
- See Also:
-
Field Summary
Fields inherited from interface javax.crypto.SecretKey
serialVersionUID -
Constructor Summary
ConstructorsConstructorDescriptionPayload nonce key constructor generates a new key using java.util.SecureRandom.nextBytes()PayloadNonceKey(byte[] key) Payload nonce key with required 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
-
PayloadNonceKey
public PayloadNonceKey()Payload nonce key constructor generates a new key using java.util.SecureRandom.nextBytes() -
PayloadNonceKey
public PayloadNonceKey(byte[] key) Payload nonce key with required byte array- Parameters:
key- Nonce consisting of 16 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
-