public class DecryptableKeyslot extends Object
| Constructor and Description |
|---|
DecryptableKeyslot() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkHmac(UserKeysWithHmacSecret userKeys)
Checks a recalculated hmac against the one stored in the keyslot.
|
static DecryptableKeyslot |
createDecryptableKeyslot(byte[] contentKey,
UserKeysForSupplier userKeysForSupplier) |
static DecryptableKeyslot |
createDecryptableKeyslot(byte[] contentKey,
UserKeysForSupplier userKeysForSupplier,
SecureRandom secureRandom)
Creates a new keyslot from the given keys.
|
static DecryptableKeyslot |
generateBogusKeyslot(SecureRandom random,
int realContentKeyLength)
Creates a useless keyslot, imitating a real one for chaffing, hiding the number of real slots.
|
byte[] |
getContentKeyLength()
Get the stored length of the content key.
|
byte[] |
getContentKeyUsing(UserKeysForConsumer userKeys) |
byte[] |
getEncapsulatedKek() |
byte[] |
getSlotHmac()
Get the stored hmac for this slot.
|
byte[] |
getWrappedContentKey()
Gets the content key in its ciphertext form.
|
public static DecryptableKeyslot createDecryptableKeyslot(byte[] contentKey, UserKeysForSupplier userKeysForSupplier)
public static DecryptableKeyslot createDecryptableKeyslot(byte[] contentKey, UserKeysForSupplier userKeysForSupplier, SecureRandom secureRandom)
contentKey - the content keyuserKeysForSupplier - key package containing all keys meeded to access this keyslotsecureRandom - random used in keyslot (in-between keys) generationpublic byte[] getContentKeyUsing(UserKeysForConsumer userKeys) throws org.bouncycastle.crypto.InvalidCipherTextException
org.bouncycastle.crypto.InvalidCipherTextExceptionpublic static DecryptableKeyslot generateBogusKeyslot(SecureRandom random, int realContentKeyLength)
random - the SecureRandom object to use in generation.realContentKeyLength - length of the real content key used when generating real keyslots.public boolean checkHmac(UserKeysWithHmacSecret userKeys)
userKeys - the keys to use in recalcuulating the macpublic byte[] getEncapsulatedKek()
public byte[] getWrappedContentKey()
public byte[] getSlotHmac()
public byte[] getContentKeyLength()
Licensed under the Apache License 2.0 - Copyright © {inceptionYear} – 2024 the original author or authors.