Class PasswordOpener
java.lang.Object
zeroecho.sdk.guard.PasswordOpener
- All Implemented Interfaces:
AutoCloseable, RecipientOpener
Recipient opener for password-based entries that derives a KEK via PBKDF2 and
unwraps the CEK with AES-GCM.
-
Constructor Summary
ConstructorsConstructorDescriptionPasswordOpener(Pbkdf2Limits limits) Creates an opener with explicit decoded-input limits. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]tryOpen(String entryId, byte[] entryBlob, UnlockMaterial material) Attempts to open a password-based recipient entry using a password unlock material.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RecipientOpener
close
-
Constructor Details
-
PasswordOpener
Creates an opener with explicit decoded-input limits.- Parameters:
limits- PBKDF2 safety limits
-
-
Method Details
-
tryOpen
public byte[] tryOpen(String entryId, byte[] entryBlob, UnlockMaterial material) throws GeneralSecurityException, IOException Attempts to open a password-based recipient entry using a password unlock material.- Specified by:
tryOpenin interfaceRecipientOpener- Parameters:
entryId- the recipient entry identifierentryBlob- the recipient entry blob encodingiter || salt || iv || wrappedCEKmaterial- the unlocking material; must contain a password- Returns:
- the recovered CEK or
nullifentryIddoes not match the password scheme or material is not applicable - Throws:
GeneralSecurityException- if PBKDF2 or AES-GCM fails or if authentication fails after a matchIOException- if entry decoding fails
-