pgp.createSigner(options)

Note:

The content in this help topic pertains to SuiteScript 2.1.

Method Description

Creates a certificate.Signer object for signing plain strings. If the given PGP key contains multiple valid signing sub keys, the most recently added will be used. This behavior is consistent with MessageData.encrypt(options) method.

Returns

certificate.Signer

Supported Script Types

Server scripts

Governance

10 units

Module

N/pgp Module

Sibling Module Members

N/pgp Module Members

Since

2022.2

Parameters

Parameter

Type

Required / Optional

Description

Since

options.key

pgp.Key

required

The pgp key.

2022.2

options.algorithm

string

required

Hash algorithm

2022.2

Errors

Error Code

Thrown If

UNSUPPORTED_COMBINATION_OF_KEY_AND_HASH_ALGORITHMS

The given key's encryption algorithm is not compatible with the given hash algorithm.

PGP_NO_SIGNING_KEY_FOUND_IN_KEY_PARAM_1

No valid signing (sub)keys are found in the given key.

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/pgp Module Script Samples.

            // Add additional code 
...

const signer = pgp.createSigner({
   key: keys.ours.pri,
   algorithm: cryptoCertificate.HashAlg.SHA256
});

...
// Add additional code 

          

Related Topics

General Notices