Sign
Signs the given requests using the specified certificate.
| $Crypto.Sign(cert: Certificate, request: SignatureRequest):SignatureResult
|
Signs the request with a matching certificate filter.
| $Crypto.Sign(input: CompositeSignatureRequest):SignatureResult
|
Parameters
Certificate cert
The certificate to use for signing.
SignatureRequest request
The request to sign.
CompositeSignatureRequest input
The request to sign, including the certificate filter and signing options.
Returns
The signature result. The signature result.
Signs plain text with a certificate
| var cert = $Crypto.GetCertificate('base64 encoded pfx content', 'password');
var result = $Crypto.Sign(cert, {
Requests: [{ Source: 'Hello World', Format: 'Cades', Level: 'BES' }]
});
|
Signs plain text with a certificate from a PKCS11 library
| 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' }]
});
|
Signs a file with a certificate from a PKCS11 library
| var cert = $Crypto.GetCertificate({
Filter: {
CommonName: 'The Name'
// SerialNumber : '1234'
},
Pin: '1111',
Library: '<path to PKCS11 library>',
});
var result = $Crypto.Sign(cert, {
Requests: [{ SourceFile: $Xml.Evaluate('MyFile'), Format: 'Cades', Level: 'BES' }]
});
|
Sign a request with a certificate from a PKCS11 library
| 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' }]
});
|
See Also