openAt<T> function
T
openAt<T>({})
Decrypts and verifies a sealed message against a time from the caller.
msgToOpen: The serialized COSE_Encrypt0 structuremsgToAuth: The same additional authenticated data used during sealingrecipient: The xHPKE secret key to decrypt withsender: The xDSA public key to verify the signature againstdomain: Application domain for HPKE key derivationmaxDriftSecs: Maximum allowed timestamp difference in seconds, past or future. A value of n accepts differences up to and including n;nullskips the check.now: Unix timestamp in seconds to measure the drift against
Returns the payload decoded by the cbor package, cast to T. Throws as
open does, with the drift measured against now.
Implementation
T openAt<T>({
required Uint8List msgToOpen,
required Object? msgToAuth,
required xhpke.SecretKey recipient,
required xdsa.PublicKey sender,
required Uint8List domain,
int? maxDriftSecs,
required int now,
}) =>
_decode(
ffi.coseOpenAt(
msgToOpen: msgToOpen,
msgToAuth: _encode(msgToAuth),
recipient: recipient.inner,
sender: sender.inner,
domain: domain,
maxDriftSecs: _drift(maxDriftSecs),
now: now,
),
)
as T;