...
Request to sign
Returns
Example
Sign a request with certificate
Code Block | ||
---|---|---|
| ||
var cert = $Crypto.GetCertificate('base64 encoded pfx content', 'password');
var result = $Crypto.Sign(cert, {
Requests: [{ Source: 'Hello World', Format: 'Cades', Level: 'BES' }]
}); |
...
Code Block | ||
---|---|---|
| ||
var cert = $Crypto.GetCertificate({
Filter: {
CommonName: 'The Name'
// SerialNumber : '1234'
},
Pin: '1111',
Library: '<path to PKCS11 library>',
});
var result = $Crypto.Sign(cert, {
Requests: [{ Source: 'Hello World', Format: 'Cades', Level: 'BES' }]
}); |
Example
Sign a request with PKCS11 library certificate
Code Block | ||
---|---|---|
| ||
var result = $Crypto.Sign({
Filter: {
CommonName: 'The Name'
// SerialNumber : '1234'
},
Pin: '1111',
Library: '<path to PKCS11 library>',
Requests: [{ Source: 'Hello World', Format: 'Cades', Level: 'BES' }]
}); |
Types
Certificate
{ // Common name of certificate issued to CommonName : string // Serial number of certificate issued to SerialNumber : string }
CompositeSignatureRequest
{ // Digest to be used. Default is SHA256 Digest : Digest // Filter of certificate to use Filter : CertificateFilter // Format of signature to generate. Default is Cades Format : SignatureFormat // Level of signature to generate. Default is BES Level : SignatureLevel // PKCS11 library path Library : string // Pin number of certificate if stored in PKCS11 library Pin : string // Data Resources to be sign Source : string }
Digest
...
SignatureFormat
...
SignatureLevel
...
signed Requests : Array<SignatureResource> }