Interface ISignatureProvider
- Namespace
- DocWright.Signatures
- Assembly
- DocWright.Signatures.dll
The seam through which a host performs the private-key operation for a signature.
public interface ISignatureProvider
Remarks
DocWright never holds a private key. It does not open a certificate store, build or validate a chain, check revocation, or decide whether a certificate should be trusted. It composes the bytes that have to be signed, hands them to this provider, and puts the returned signature into the document. A host that signs with a smart card, an HSM or a cloud key service implements this interface; DocWright learns about none of them.
This is the same posture the library takes everywhere else: DocWright reports, the
host decides. It is a deliberate boundary and not a scoping convenience — see
COMPAT.md.
Implementations must be safe to call from multiple threads if the document they sign is shared; DocWright itself is stateless and makes no ordering guarantees beyond calling GetCertificate() before SignData(byte[], SignatureHashAlgorithm).
Methods
- GetCertificate()
Returns the signer's certificate, DER-encoded (an X.509
Certificatestructure).
- SignData(byte[], SignatureHashAlgorithm)
Signs
datawith the private key belonging to the certificate returned by GetCertificate().