Skip to main content

Approval Notification Service

The Timestamp Notification service is employed to sign timestamp upon fetching approval tasks /v1/filteredSignApprovalTask. This proves beneficial when aiming for a centralized approach to handle and distibuting approval tasks for various approvers.

However, it's important to note that the Timestamp Notification Service cannot sign the 'approvalToBeSigned' tasks directly, but can fetch the tasks for approvers.

Creating a timestamp-signer certificate

The command below generates a RSA:4096 key and a self-signed certificate, which is being used to verify the signed timestamp by the timestamp-signer-key.

    openssl req -new -x509 -nodes -sha256 -newkey rsa:4096 -days 3650 -subj '/CN=TSB-Timestamp-Signer' -keyout tsb-timestamp-signer.key -out tsb-timestamp-signer.crt

Generated files:

  • tsb-timestamp-signer.crt
  • tsb-timestamp-signer.key

Onboard the Timestamp Signing Certificate on TSB

To check the timestamp signature for approval-task retrieval, add the timestamp signing certificate to the application.yml file in TSB's application-local.yml configuration file.

CloudsHSM - TSB(aaS)

if you are using Securosys TSBaaS, please open a support-ticket and send the certificate attached to the ticket, we will onboard the timestamp signing certificate for you.

Locally deployed TSB instances need to configure the Certificate manually, by following these steps:

  1. Open application-local.ymlof your TSB-deployment.
  2. Find or add general.allowedTimestampSigningCertificates
  3. Add the certificate filepath to the list of allowedTimestampSigningCertificates
  4. Redeploy the docker container, make sure, the certificate exists at the given file-location and is properly mapped into your containers volume.

Example:

general:
allowedTimestampSigningCertificates: # optional, configured certificates can fetch and delete all tasks for an approver
- file:/etc/app/config/tsb-timestamp-signer.crt


Creating a Approver (Key)

Various samples on how to create an Approval key for finance-officer-1 is show here: Create Approver Key

Create an SKA-Key with finance-officer-1 onboarded

POST: /v1/key

By including the public-key of the previously created finance-officer-1 in the SKA-Key, you designate the officer responsible for approving signing and encryption requests.

The following request creates a Elliptic Curve SKA-Key with simple policy, e.g. only ruleUse is applied, ruleBlock, ruleUnblock, ruleModify is ignored and stays empty.

  • Adapt the command below with the public-key of the finance-officer-1 created above.
{
"label": "Broker-Transaction-Key-01",
"algorithm": "EC",
"curveOid": "1.3.132.0.10",
"attributes": {
"encrypt": true,
"decrypt": true,
"verify": true,
"sign": true,
"wrap": true,
"unwrap": true,
"derive": false,
"bip32": false,
"extractable": false,
"modifiable": true,
"destroyable": true,
"sensitive": true,
"copyable": true
},
"policy": {
"ruleUse": {
"tokens": [
{
"name": "FinanceOfficers",
"timelock": 0,
"timeout": 600,
"groups": [
{
"name": "finance-officer1",
"quorum": 1,
"approvals": [
{
"type": "public_key",
"value": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEBSBisLXR8Lsdpsc9JFeFYzMegPqufyNjk6ncWOFbb9bPMuM3I6SSDzwFNX+XvVO1EkfavxaXQcH43sEuKeYGKw=="
}
]
}
]
}
]
},
"ruleBlock": null,
"ruleUnblock": null,
"ruleModify": null,
"keyStatus": {
"blocked": false
}
}
}

Create a sign-request

POST: /v1/sign

Generate a sign request to be approved by the approver finance-officer-1. You can use the metadata-field to provide information to the approver about the contents of the sign request.

{
"signRequest": {
"payload": "c2VjdXJvc3lz",
"payloadType": "UNSPECIFIED",
"signKeyName": "Broker-Transaction-Key-01",
"keyPassword": null,
"metaData": "ewoiYXBsaWNhdGlvbl9uYW1lIjoiSENWYXVsdCIsCiJjb3JlcyI6InRyYW5zYWN0aW9uLXNpZ25pbmciCn0=",
"signatureAlgorithm": "NONE_WITH_ECDSA"
}
}

TSB has created approval tasks for each onboarded approver in the backend. In our case only one task for finance-officer-1. These tasks must now be retrieved and approved, as shown below.

Response

{
"signRequestId": "c0743837-cd46-4f3f-8822-b4f256d86bd2"
}

Fetch approval task

The approval task can now be fetched by the timestamp-signer, that we previously onboarded in the application-local.yml.

  • The timestamp 2024-02-08T10:12:46+00:00 is signed by the timestamp-signer.key and the signature passed on to the timestampSignature field.
  • The timestampSigningCertificate is the certificate previously onboarded in the application-local.yml
  • The approverPublicKey is (optional), if specified the task can be fetch for one specific approver.

POST: /v1/filteredSignApprovalTask

{
"timestamp": "2024-02-08T11:17:30+00:00",
"timestampSignature": "XOesAfEV1RiTySjKocOlYxqjZpErMXnV5xOflTM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DGIWQoqrKhIPTyLnxzFDCIubLyt2cF23slrTsnulhmCaXrWHoKTYdFMo2wzV25ABUJUJoCZSxgtXjVPkM8VcKJk2AnD3sv9EOkx+U/syzvv6amduRLF5eDgxTPn/O7Gh+WKgify9KvbHFbEPkk3Xq0zv26sWGRDzGe20zxpFeYOaibDkJ/5Ymv2/RHjMYALBMaHixru0PnFSER/+akQxjl0xPoEyJ9GkhulVcPaawyP6aJsIDnOd/hSZLS7wT+H3tvC4pY4A==",
"approverPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEBSBisLXR8Lsdpsc9JFeFYzMegPqufyNjk6ncWOFbb9bPMuM3I6SSDzwFNX+XvVO1EkfavxaXQcH43sEuKeYGKw==",
"timestampDigestAlgorithm": "SHA-256",
"detailLevel": "level1",
"paging": {
"pageNumber": 0,
"pageSize": 1,
"sortOrder": "CREATION_DATE_ASC"
}
}
tip

The response is a challenge approvalToBeSigned that needs to be signed by the approver named "finance-office-1." Respone:

{
"tasks": [
{
"detailLevel": "level1",
"id": "c8dfe0b7-9e4b-4f1b-b792-dcc62eb650f9",
"approvalToBeSigned": "0AAAADsABAABAAAAAhAZAEJyb2tlci1UcmFuc2FjdGlvbi1LZXktMDEAAABUEDQAMAAAAFcQCQBzZWN1cm9zeXMAAAAHAQgA9bfEZQAAAAACEA0AdGltZXN0YW1wLWtleQAAAFYQWgAwWDAMBggqhkjOPQQDAgUAA0gAMEUCID1N3RL1dIikAHTWiQWWtwLUdFIRHS2ZqAhx46ZsJU8yAiEA6LzgUSw+dVbFUUvOI/XkgZu739yvejXSZcMUvOjPW7YAAFcQCQBzZWN1cm9zeXMAAAA=",
"approverPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEBSBisLXR8Lsdpsc9JFeFYzMegPqufyNjk6ncWOFbb9bPMuM3I6SSDzwFNX+XvVO1EkfavxaXQcH43sEuKeYGKw=="
}
]
}