The cryptographic algorithm identifier used for signing operations.
Typically, this value is used to populate the alg
field of a JWT or JWS header. The
registered algorithm names are defined in the
IANA JSON Web Signature and Encryption Algorithms registry.
"ES256" // ECDSA using P-256 and SHA-256
The unique identifier of the key within the DID document that is used for signing and verification operations.
This identifier must be a DID URI with a fragment (e.g., did:method:123#key-0) that references
a specific verification method in the DID document. It allows users of a BearerDidSigner
to
determine the DID and key that will be used for signing and verification operations.
"did:dht:123#key-1" // A fragment identifier referring to a key in the DID document
Signs the provided data.
The parameters for the signing operation.
A Promise resolving to the digital signature as a Uint8Array
.
The sign()
method of the Signer
interface generates a digital signature
for the given data using a cryptographic key. This signature can be used to verify the data's
authenticity and integrity.
Verifies a digital signature associated the provided data.
The parameters for the verification operation.
A Promise resolving to a boolean indicating whether the signature is valid.
The verify()
method of the Signer
interface checks the validity of a
digital signature against the original data and a cryptographic key. It confirms whether the
signature was created by the holder of the corresponding private key and that the data has not
been tampered with.
A
BearerDidSigner
extends the Signer interface to include specific properties for signing with a Decentralized Identifier (DID). It encapsulates the algorithm and key identifier, which are often needed when signing JWTs, JWSs, JWEs, and other data structures.Typically, the algorithm and key identifier are used to populate the
alg
andkid
fields of a JWT or JWS header.