NTPSetOptionString (signatures)

 

Digitally signing PDF documents

 

With the interface to webPDF, NotesToPaper enables you to digitally sign (with an electronic signature) PDF documents by adding a signature through a digital certificate. This makes it possible to confirm the authenticity (identify the signer) of PDF documents, protecting them from changes and tampering.

 

Note: Please, note that the functionality for attaching a digital signature is only available to you for the file type PDF, if it was generated via NTPExportReport(PDF).

 

When creating your PDF documents, you can now sign them at the end with a digital certificate. To do this, webPDF adds an appropriate certificate to the document. During the process, you can configure various settings, including the visibility and position of the certificate.

 

By using an appropriate classification (e.g., "qualified electronic signature" or "advanced electronic signature"), you can sign documents in accordance with all applicable laws. This means, for example, that you can use this web service for eInvoices (electronic invoices) and archiving systems (tamper-proof archiving).

 

webPDF makes it possible to use certificates from a certification authority (CA) or "self-signed" certificates. The certificates used are X.509 standard certificates.

 

The following settings allow you to control the use of the signature service from NotesToPaper. All options are set via the function NTPSetOptionString or NTPSetOption. The function supports the following parameters:

 

Note: You can find a signature service example in our "NTPPDF 8.0 Sample" database.

 

 

NTPOPTION_SIGNATURE_ENABLED

Enables the signature service. All the following options will become applicable only after this option is enabled.

 

NTPOPTION_ENABLED

Enable signature service

NTPOPTION_DISABLED

Disable signature service

 

Example:

Call NTPSetOption ( ReportID, NTPOPTION_SIGNATURE_ENABLEDNTPOPTION_ENABLED, "" )

 

 

NTPOPTION_SIGNATURE_KEYSTORE_NAME

Defines the name of the key (alias) that should be used when signing the document. This setting overwrites the server's configuration setting.

 

Example:

Call NTPSetOptionString ( ReportID, NTPOPTION_SIGNATURE_KEYSTORE_NAME, "default", "" )

 

 

NTPOPTION_SIGNATURE_KEYSTORE_PASSWORD

Defines the password required for access to the private key that was set with the NTPOPTION_SIGNATURE_KEYSTORE_NAME option. This setting overwrites the server's configuration setting.

Example:

Call NTPSetOptionString ( ReportID, NTPOPTION_SIGNATURE_KEYSTORE_PASSWORD, "NotesToPaper", "" )

 

NTPOPTION_SIGNATURE_REASON

Defines the reason for signing the document.

 

Example:

Call NTPSetOptionString ( ReportID, NTPOPTION_SIGNATURE_REASON, doc.Reason(0), "" )

 

 

NTPOPTION_SIGNATURE_LOCATION

Defines the location where the document was signed.

 

Example:

Call NTPSetOptionString ( ReportID, NTPOPTION_SIGNATURE_LOCATION, doc.Location(0), "" )

 

 

NTPOPTION_SIGNATURE_CONTACT

Defines the name of the signer.

 

Example:

Call NTPSetOptionString ( ReportID, NTPOPTION_SIGNATURE_CONTACT, doc.Contact(0), "" )

 

 

NTPOPTION_SIGNATURE_CERT_LEVEL (Default: 1)

This parameter is used to define the signature's level.

 

0

Sign the document but do not certify it, i.e., additional signatures and further changes are possible

1

Certify document and do not allow any additional changes

2

Certify document, but allow fields to be filled out

3

Certify document, but allow fields to be filled out and comments to be added

 

Example: The signed document was certified; filling out fields is allowed.

Call NTPSetOption ( ReportID, NTPOPTION_SIGNATURE_CERT_LEVEL, "2", "" )

 

 

NTPOPTION_SIGNATURE_PAGE (Default: 1)

Defines the page on which the signature is shown.

 

Example: The signature is found on the first page.

Call NTPSetOption ( ReportID, NTPOPTION_SIGNATURE_PAGE, "1", "" )

 

 

NTPOPTION_SIGNATURE_VISIBLE (Default: NTPOPTION_DISABLED)

You can use this option to decide whether the signature should be shown visibly in the document or whether it should be stored invisibly in the document.

 

NTPOPTION_ENABLED

Signature is visible (see NTPOPTION_SIGNATURE_PAGE option)

NTPOPTION_DISABLED

Signature is stored invisibly in the document

 

Example: The signature is shown visibly in the document.

Call NTPSetOption ( JobID, NTPOPTION_SIGNATURE_VISIBLE, NTPOPTION_ENABLED, "" )

 

 

NTPOPTION_SIGNATURE_FIELD

Defines the name of the field in the document where the signature is saved. If a field name that already exists is specified here, a unique name will be calculated automatically.

 

Note: The "field name" here does not refer to a Notes field name, but rather to a unique name in the PDF document in which the signature will be saved.

 

Example:

Call NTPSetOptionString ( JobID, NTPOPTION_SIGNATURE_FIELD, "security", "" )

 

 

NTPOPTION_SIGNATURE_IDENTIFIER

Defines the application that was used to signed the document. This information will be shown if the signature is visibly shown in the document. In this case, the value is shown in the visual element.

 

Example:

Call NTPSetOptionString ( ReportID, NTPOPTION_SIGNATURE_IDENTIFIER, "Lotus Notes", "" )

 

 

NTPOPTION_SIGNATURE_APPEND

You can use this option to define whether or not the new signature should be added if there is already a signature in the document.

 

NTPOPTION_ENABLED

Add signature to the existing one

NTPOPTION_DISABLED

Do not add signature to the existing one

 

Note: If the signature should not be added to an existing signature, NotesToPaper will show an error message.

 

Example:

Call NTPSetOption ( ReportID, NTPOPTION_SIGNATURE_APPENDNTPOPTION_ENABLED, "" )