Key object usage
Details about the various formats when defining a key object in a GatewayScript API.
In an API, you can specify a key object in one of the following formats.
- A String object
- A Buffer or Buffers object
- An Object, which is one of the following formats.
{key: buffer_object}{key: buffer_object, passphrase: string}{key: buffers_object}{key: buffers_object, passphrase: string}
Depending on the API, at least one of the following key types is supported.
Private key
The following table provide usage details for defining a private key in an API.
| Object format | Details |
|---|---|
| A String object | Refer to the name of the key alias configuration. For XSLT key prefix details, see dp:sign(). |
| A Buffer or Buffers object | PEM formatted base64 encoded data of the private key. |
| An Object | The value of the key property is the base64 encoded data of the private key.
The passphrase property is used when defined. |
Public key
The following table provide usage details for defining a public key in an API.
| Object format | Details |
|---|---|
| A String object | Refer to the name of the certificate alias configuration. For XSLT key prefix details, see dp:verify(). |
| A Buffer or Buffers object | PEM formatted base64 encoded data of the public key. |
| An Object | The value of the key property is the base64 encoded data of the public key.
The passphrase property is ignored even when defined. |