Pdf | |
The PdfPkcs11Signer type exposes the following members.
| Name | Description | |
|---|---|---|
| PdfPkcs11Signer(String, String, String, String) | Creates a signer for a key on a PKCS#11 token, reading its certificate from the token. | |
| PdfPkcs11Signer(String, String, String, String, IListByte) | Creates a signer for a key on a PKCS#11 token, with certificates given by the caller - for a token that holds the key but not its certificate or chain. |
| Name | Description | |
|---|---|---|
| Certificates | Gets the certificates embedded in the signature, each DER-encoded: the signing certificate first, then the certificates of its issuers. |
| Name | Description | |
|---|---|---|
| Dispose | Closes the session on the token (the token logs out when its last session closes) and unloads the vendor library when no other signer uses it. | |
| Sign | Signs the request with the key on the token. |
The signer loads the vendor library, opens a session on the token with the given label, logs in with the PIN and finds the private key with the given label. The signing certificate is read from the token (the certificate with the key's identifier) unless the certificates are given, and the issuer certificates are completed from the token, the system stores and the issuers' download locations. The session stays open until the signer is disposed, so one signer can sign any number of documents.
RSA keys (PKCS#1 v1.5) and ECDSA keys are supported. A key that requires the PIN for every signature (a qualified signature card, for example) is given the PIN again for each signature.
The vendor library must match the process: a 64-bit application needs the vendor's 64-bit library. Common locations: C:\Windows\System32\eTPKCS11.dll (SafeNet), /usr/lib/softhsm/libsofthsm2.so (SoftHSM), /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so (OpenSC).