Full flow PAdES

Full flow PAdES API and implementation guide.

Sign order expiration time

The sign order will expire in 90 seconds after it is created if user signing is not initiated (i.e. request to authorization endpoint).

The timeout for the sign order when user is signing is determined by the timeoutSeconds (default 1800 seconds) specified when the order was uploaded.

After the user has signed the order, the sign order will be valid for another 90 seconds before it expires.

API

See signdoc/pades documentation.

Claims

The following table shows the supported claims in response from the sign service after a PAdES sign session is completed.

ClaimExampleResult specifierDescription
unsignedDocumentSha256
"unsignedDocumentSha256": "ZfesfmamB+ADft4A0DVMAbHQ7mEeg24v3PXBsXDKf5k="
documentHash
Hash over the original document
signedDocumentSha256
"signedDocumentSha256": "ApPACd0HXMzuSB/Zt1HU9oJLAxpWvRX2/gRpu63Vs1k="
documentHash
Hash over the signed document
padesSignedPdf
"padesSignedPdf": "JVBERi0xLjQNJeLjz9MNCjEwIDAgb2JqDTw8L0xpbmVhcml6...
padesSignedPdf
The signed pdf as a base64 encoded text string
padesAppendix
"padesAppendix": "DQoxMSAwIG9iago8PAovTWV0YWRhdGEgMiAwIFIKL09wZW5BY...
padesAppendix
The signature data added to the original PDF represented as base64
description
"description": "some_document.pdf"

Description of the document
signId
"signId": "058d8691-6f2d-40c0-b6fb-f120a868cf48"

The sign_id reference
orderState
"SIGN_COMPLETED"

The current order state
orderName
"Overlay-example"

Name of the order

Step-by-step

StepWhat you doEndpointMethodConsiderationsRemarks
1

Get the key properties of the OIDC provider

openid-configurationGET

2Request an Access tokentokenPOSTGrant type client_credentials. Must include the signdoc/read_write scope.The access token is retreived with client credentials grant, i.e. without the involvement of the end user
3Create and upload sign order to the SignDoc resource serversigndoc/padesPOSTInclude Access token (2) as Bearer tokenYou'll receive a reference sign_id
4Initiate the signing transaction by redirecting the user to the authorization endpointauthorizeGET

Include the sign scope and sign_id reference as query parameters.

In the callback, make sure to check for error and matching states

Traditional authorization code flow starts.

End user performs the signing process with netcentric BankID. Results are stored in the resource server.

5Exchange authorization code for tokenstokenPOSTCheck matching nonce
6Fetch our public keys and use these to validate token signaturesjwkGET

7*Check the status of sign ordersigndoc/padesGETInclude Access token (2) as Bearer token. Include sign_id as query parameter.

*Can be skipped if showConfirmation is set to false when creating a sign order (see Upload sign order to SignDoc resource server in the PAdES documentation for details).

The merchant should poll this endpoint for the active signing session and update the status in their backend. This should be done until SIGN_COMPLETED or CANCELLED is received. Please do not call this endpoint more frequently than every 30 seconds for a given sign order.

For more details, see Check Status for sign order in the PAdES documentation.

8

Download sign order results and delete sign order

signdoc/padesDELETEInclude Access token (2) as Bearer token. Include sign_id as query parameter.

Should be called when end-user is redirect back to the merchant or if polling returns the SIGN_COMPLETED status. If callback was received, remember to stop the asynchronous polling for the sign order (7).

(warning) Note that the sign order is deleted regardless of the state of the sign order.

For more details, see

  • Check Status for sign order, and
  • Delete sign order and download signing results

in the PAdES documentation

Sequence diagram