Signature électronique
L'objet signature ajoute une signature numérique cryptographique au PDF généré. Les signatures fournissent la non-répudiation et la détection de falsification — toute modification du PDF signé invalide la signature.
Propriétés
| Propriété | Type | Défaut | Description |
|---|---|---|---|
fieldName | string | — | Nom du champ de formulaire de signature |
position | object | — | Position fixe sur la page (voir ci-dessous) |
appearance | object | — | Apparence visuelle du bloc de signature |
signatureCreator | string | — | Nom de l'application enregistrée comme créateur de signature |
signingType | string | "PAdES" | Norme de signature : PAdES ou Detached |
certificate | string | — | Chemin d'accès au fichier de certificat PKCS#12 (.p12/.pfx) |
password | string | — | Mot de passe du fichier de certificat |
contact | string | — | Informations de contact du signataire |
timestampServer | string | — | URL d'une autorité d'horodatage RFC 3161 (optionnel) |
visible | boolean | true | Si le bloc de signature est visible sur la page |
claimedSignDate | string | heure actuelle | Chaîne de date au format yyyy.MM.dd HH:mm:ss K |
certificationLevel | string | "NO_CHANGES_PERMITTED" | Quelles modifications sont autorisées après la signature |
fieldLock | object | — | Verrouiller les champs de formulaire spécifiques après la signature |
style | string | — | Référence de style nommé pour l'apparence de la signature |
Types de signature
| Type | Description |
|---|---|
PAdES | Signature électronique avancée en PDF — intégrée dans le PDF selon ETSI EN 319 142. Recommandé pour la plupart des cas d'usage. |
Detached | Signature CMS/CAdES détachée — la signature est un objet CMS séparé. Utilisée quand l'interopérabilité avec les systèmes non-PDF est nécessaire. |
Position
L'objet position place le bloc de signature visible à un emplacement fixe.
| Propriété | Type | Défaut | Description |
|---|---|---|---|
pageNumber | number | 1 | Numéro de page basé sur 1 |
left | number | 100 | Distance du bord gauche en points |
bottom | number | 150 | Distance du bord inférieur en points |
width | number | 160 | Largeur du bloc de signature en points |
height | number | 50 | Hauteur du bloc de signature en points |
Apparence
L'objet appearance contrôle ce qui s'affiche dans le bloc de signature visible.
| Propriété | Type | Description |
|---|---|---|
signedBy | string | Nom du signataire affiché dans le bloc |
signDate | string | Chaîne de date affichée dans le bloc |
reason | string | Raison de la signature (par ex., « Approuvé », « Examiné ») |
location | string | Localisation du signataire (par ex., « Portland, OR ») |
image | object | Image optionnelle (par ex., signature scannée) avec src, width, height |
Niveaux de certification
| Niveau | Description |
|---|---|
UNSPECIFIED | Par défaut — aucune certification appliquée |
NO_CHANGES_PERMITTED | Aucune modification autorisée après la signature |
FORM_FIELDS_MODIFICATION | Seul le remplissage des champs de formulaire est autorisé |
ANNOTATION_MODIFICATION | Le remplissage des formulaires et les annotations sont autorisés |
Verrouillage des champs
L'objet fieldLock restreint les modifications des champs de formulaire après la signature.
| Propriété | Type | Description |
|---|---|---|
lockPermissions | string | NO_CHANGES_ALLOWED, FORM_FILLING, ou FORM_FILLING_AND_ANNOTATION |
fieldLockAction | string | ALL (verrouiller tous les champs) ou INCLUDE/EXCLUDE avec lockedFields |
lockedFields | string[] | Noms des champs spécifiques à verrouiller ou à exclure du verrouillage |
Exemples
Signature visible basique
{
"document": {
"signature": {
"fieldName": "approval_sig",
"certificate": "/certs/signer.p12",
"password": "certPassword",
"signingType": "PAdES",
"signatureCreator": "DocPayload",
"contact": "legal@company.com",
"visible": true,
"position": {
"pageNumber": 1,
"left": 350,
"bottom": 50,
"width": 200,
"height": 60
},
"appearance": {
"signedBy": "Lisa Thompson",
"reason": "Approved",
"location": "Portland, OR"
}
},
"content": [
{ "p": "This document has been reviewed and approved." }
]
}
}
Signature invisible
{
"document": {
"signature": {
"fieldName": "integrity_sig",
"certificate": "/certs/system.p12",
"password": "systemPass",
"signingType": "PAdES",
"signatureCreator": "DocPayload",
"visible": false,
"certificationLevel": "NO_CHANGES_PERMITTED"
},
"content": [
{ "p": "This document is digitally signed for integrity verification." }
]
}
}
Signature avec serveur d'horodatage
{
"document": {
"signature": {
"fieldName": "timestamped_sig",
"certificate": "/certs/signer.p12",
"password": "certPassword",
"signingType": "PAdES",
"signatureCreator": "DocPayload",
"timestampServer": "http://timestamp.digicert.com",
"visible": true,
"position": {
"pageNumber": 1,
"left": 50,
"bottom": 50,
"width": 200,
"height": 60
},
"appearance": {
"signedBy": "Automated System",
"reason": "Generated and signed",
"location": "Cloud"
}
},
"content": [
{ "p": "Signed with a trusted timestamp for long-term validation." }
]
}
}
Signature avec verrouillage de champs
{
"document": {
"signature": {
"fieldName": "final_approval",
"certificate": "/certs/approver.p12",
"password": "approverPass",
"signingType": "PAdES",
"signatureCreator": "DocPayload",
"certificationLevel": "FORM_FIELDS_MODIFICATION",
"fieldLock": {
"lockPermissions": "FORM_FILLING",
"fieldLockAction": "ALL",
"lockedFields": []
},
"visible": true,
"position": {
"pageNumber": 1,
"left": 350,
"bottom": 50,
"width": 200,
"height": 60
},
"appearance": {
"signedBy": "Final Approver",
"reason": "Final approval — all fields locked",
"location": "Head Office"
}
},
"content": [
{ "p": "After signing, no form fields can be modified." }
]
}
}