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.
The
Signer
interface provides methods for signing data and verifying signatures.It includes
sign()
for creating signatures andverify()
for confirming the validity of signatures. The interface is designed to be flexible, accommodating various signing algorithms and their unique parameters.It defaults to using
EnclosedSignParams
andEnclosedVerifyParams
, which are intended to be used with a closure that captures the key and algorithm-specific parameters so that arbitrary data can be signed and verified without exposing the key or parameters to the caller. However, the interface can be extended to support other parameter types, such asSignParams
andVerifyParams
, which are intended to be used when the key and algorithm-specific parameters are known to the caller.