Class PasswordRecipient
java.lang.Object
zeroecho.sdk.guard.PasswordRecipient
- All Implemented Interfaces:
AutoCloseable, Destroyable, Recipient
public final class PasswordRecipient
extends Object
implements Recipient, Destroyable, AutoCloseable
Password recipient that derives a KEK via PBKDF2(HMAC-SHA-256) and wraps the
CEK with AES-GCM.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]buildRecipientEntry(byte[] cek) Builds the recipient entry blob for this password recipient.voidclose()Closes this recipient by destroying its retained password copy.booleandecoy()Returns whether this recipient entry is marked as a decoy.voiddestroy()id()Returns the recipient entry identifier used in the header.boolean
-
Method Details
-
id
-
buildRecipientEntry
Builds the recipient entry blob for this password recipient.- Specified by:
buildRecipientEntryin interfaceRecipient- Parameters:
cek- the CEK to wrap- Returns:
- a blob containing
pack7(iter) || salt || wrapIv || wrappedCEK - Throws:
GeneralSecurityException- if PBKDF2 or AES-GCM failsIOException- if blob assembly fails
-
decoy
public boolean decoy()Returns whether this recipient entry is marked as a decoy.A decoy recipient is syntactically valid but intentionally unusable for recovering the content-encryption key (CEK). Such entries are included to conceal the number and identity of real recipients within a multi-recipient envelope.
-
destroy
public void destroy()- Specified by:
destroyin interfaceDestroyable
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyedin interfaceDestroyable
-
close
public void close()Closes this recipient by destroying its retained password copy.- Specified by:
closein interfaceAutoCloseable
-