N/crypto/certificate Module

Use the N/crypto/certificate module to sign XML documents or strings with digital certificates using asymmetric cryptography.You can also use this module to create signer and verifier objects and verify signed documents with this module.

                                   

In This Help Topic

N/crypto/certificate Module Members

Member Type

Name

Return Type/Value Type

Supported Script Types

Description

Object

certificate.SignedXml

Object

Server scripts

Object for an XML string that has been digitally signed.

Use certificate.signXml(options) to create this object.

certificate.Signer

Object

Server scripts

Object for creating signatures for plain strings.

Use certificate.createSigner(options) to create this object.

certificate.Verifier

Object

Server scripts

Object for verifying plain string signatures.

Use certificate.createVerifier(options) to create this object.

Method

certificate.verifyXmlSignature(options)

void

Server scripts

Verifies the signature in the SignedXml.asFile() file.

certificate.createSigner(options)

certificate.Signer

Server scripts

Creates a signer object for signing plain strings.

certificate.createVerifier(options)

certificate.Verifier

Server scripts

Creates a verifier object for verifying signatures of plain strings.

certificate.signXml(options)

certificate.SignedXml

Server scripts

Signs the input XML string using the Certificate ID. Returns the SignedXml as a string.

Note:

Formatting, such as line breaks, is disabled in signatures.

Enum

certificate.HashAlg

enum

Server scripts

Holds the string values for hash algorithm types.

Signer Object Members

The following members are called on the certificate.Signer object.

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Method

Signer.sign(options)

void

Server scripts

Signs the string and returns the signature.

Signer.update(options)

void

Server scripts

Updates the input string to be signed. The string can be encoded.

Verifier Object Members

The following members are called on the certificate.Verifier object.

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Method

Verifier.update(options)

void

Server scripts

Updates the string to be verified against specified certificate.

Verifier.verify(options)

void

Server scripts

Verifies the string against provided signature using specified certificate.

SignedXml Object Members

The following members are called on the certificate.SignedXml object.

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Method

SignedXml.asFile()

file.File

Server scripts

Returns the signed XML as a file object.

SignedXml.asString()

string

Server scripts

Returns the signed XML as a string.

SignedXml.asXml()

xml.Document

Server scripts

Returns the signed XML as an XML document. You can use the N/xml Module with this document to access elements and attributes in the XML.

Related Topics

SignedXml.asFile()
SignedXml.asString()
SignedXml.asXml()

General Notices