peek<T> function

T peek<T>({
  1. required Uint8List signature,
})

Extracts the embedded payload from a COSE_Sign1 signature without verifying it.

The payload is unauthenticated and must not be trusted until verified with verify. Use signer to extract the signer's fingerprint for key lookup.

  • signature: The serialized COSE_Sign1 structure

Returns the embedded payload decoded by the cbor package, cast to T. Throws if the envelope is malformed, has no embedded payload or its payload falls outside the supported CBOR subset.

Implementation

T peek<T>({required Uint8List signature}) =>
    _decode(ffi.cosePeek(signature: signature)) as T;