pgp.createSigner(options)
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 |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
10 units |
Module |
|
Sibling Module Members |
|
Since |
2022.2 |
Parameters
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
required |
The pgp key. |
2022.2 |
|
|
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
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