pgp.parseKey(options)
The content in this help topic pertains to SuiteScript 2.1.
Method Description |
Parses an existing PGP key. Use pgp.loadKeyFromSecret(options) to load private keys. |
Returns |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Sibling Module Members |
|
Since |
2022.2 |
Parameters
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
string |
required |
ASCII armored key |
|
string |
optional |
Password to unlock the key. Applicable for private keys. |
Errors
Error Code |
Thrown If |
---|---|
PGP_ |
Parsing of the key fails. |
PGP_YOU_CANNOT_PROVIDE_PASSWORD_FOR_A_PUBLIC_KEY |
You provide a password when the key is public. |
PGP_INVALID_KEY_PASSWORD |
You provide a wrong password or the private key is not password protected. |
PGP_THIS_KEY_IS_PASSWORD_PROTECTED |
You don't provide any password, but the private key is password protected. |
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 parseKey = pgp.parseKey({ value: 'custsecret_ascii_armored_key' })
...
// Add additional code