@techteamer/timestamp
v1.0.4
Published
This package contains a TimestampService, which can create and verity timestamps
Downloads
2,274
Readme
Timestamp
Trustedtimestamp service implements the generate and verification of timestamps.
Install
$ yarn add @techteamer/timestamp
Usage
const { TrustedTimestampService: TrustedTimestampServiceLib } = require('@techteamer/timestamp')
...
this.trustedTimestampService = new TrustedTimestampServiceLib('normal', config.get('trustedTimestamp'), config.get('certService.encoding', 'latin1'))
Params
- TimestampInfo output type format: normal, short
- config: prodiders and cert location, config.get('trustedTimestamp')
- encode type(optional): config.get('certService.encoding', 'latin1')
Default config
"trustedTimestamp": {
"certsLocation": "/etc/ssl/certs/",
"providers": [
{
"name": "bteszt",
"url": "https://bteszt.e-szigno.hu/tsa",
"auth": {
"user": "<username>",
"pass": "<password>"
}
}
]
}
Config provider options
Required fields
- name (string)
- url (string | object): Simple url string or object {getTokenUrl: string, getTimestampUrl: string}
Optional fields
- auth (object): Username and password for auth (object): {user: string, pass: string}
- priority (number) - The order of the service providers can be changed, the higher number is the first
- body (object) - The infocert type provider can set body parameter
Config example
"trustedTimestamp": {
{
"certsLocation": "/etc/ssl/certs/",
"providers": [
{
"name": "bteszt",
"url": "https://bteszt.e-szigno.hu/tsa",
"auth": {
"user": "<username>",
"pass": "<password>"
}
},
{
"name": "infocert 1 test",
"priority": 999,
"url": {
"getTokenUrl": "https://idpstage.infocert.digital/auth/realms/delivery/protocol/openid-connect/token",
"getTimestampUrl": "https://apistage.infocert.digital/timestamp/v1/apply"
},
"auth": {
"user": "<username>",
"pass": "<password>"
},
"body": {
"grant_type": "client_credentials",
"scope": "timestamp"
}
}
]
}
}
Public methods
getTimestampInfo
createTimestampToken
verifyToken
verifyTsr
testService