public class Keys extends Object
Container or decrypt a SecuredContainer. There
is a cipher key (encrypt/decrypt) and a mac key (content validation to avoid tampering).| Constructor and Description |
|---|
Keys()
Create a new set of Keys using
CipherTransformation.AES_CTR_NOPADDING, MacAlgorithm.HMACSHA384
and new random keys. |
Keys(CipherTransformation cipherTransformation,
byte[] cipherKey,
MacAlgorithm macAlgorithm,
byte[] macKey)
Create a keys object using the parameters.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Keys keys)
Check to see if the passed in key equals this key (cipher transformation, cipher key, mac algorithm and mac key)
|
boolean |
equals(Object obj) |
byte[] |
getCipherKey()
Get the cipher key.
|
CipherTransformation |
getCipherTransformation()
Get the cipher transformation used when encrypting and decrypting with the cipher key.
|
MacAlgorithm |
getMacAlgorithm()
Get the mac algorithm to use when creating or verifying a digest with the mac key.
|
byte[] |
getMacKey()
Get the mac key to use when creating or verifying a digest.
|
UUID |
getUserId()
Get the user's id that created the keys.
|
int |
hashCode() |
void |
setUserId(UUID userId)
Set the user's id that created the keys.
|
public Keys()
CipherTransformation.AES_CTR_NOPADDING, MacAlgorithm.HMACSHA384
and new random keys.public Keys(CipherTransformation cipherTransformation, byte[] cipherKey, MacAlgorithm macAlgorithm, byte[] macKey)
cipherTransformation - the cipher transformation to be used with the cipher keycipherKey - the cipher key for encryption/decryption operationsmacAlgorithm - the mac algorithm used with the mac key for data validationmacKey - the mac key used to create and verify digests - data validationpublic boolean equals(Keys keys)
keys - the key to compare to this keypublic byte[] getCipherKey()
Container and decryption of a
SecuredContainer.public CipherTransformation getCipherTransformation()
public MacAlgorithm getMacAlgorithm()
public byte[] getMacKey()
public UUID getUserId()
public void setUserId(UUID userId)
userId - the user's id that created the keysCopyright © 2021. All rights reserved.