REST API

Generating a Token Signature

You can now build the JSON token signature. The token signature is made up of the JWT header and claim set hashes in the following format, and encrypted with the private key.
[Token Header].[Claim Set]
Follow these steps to generate the signature:
  1. Concatenate the header and claim set hash strings with a period (.) separating the hashes:
    [Token Header].[Claim Set]
    .
  2. Generate an encoded version of the text file using your private key.
  3. Base64 encode the signature output.

Example: Token Signature Hash

YjgwNGIxOTMxMzQ2NzhlYjdiMDdhMWZmYjZiYzUzNzliMTk5NzFmNjAzNWRmMThlNzk0N2NhY2U0YTEwNzYyYQ==

Code Example: Encoding the Signature File Using OpenSSL

Encode the signature file using the
openssl
tool.
openssl rsautl -encrypt -inkey publickey.key -pubin -in [signature-text-file] > [signature-encoded-file]

Code Example: Base64 Encoding the Signature File Using the Command Line

Encode the signature file using the
openssl
tool.
base64 -i [signature-encoded-file]

Code Example: Decoding the Signature File Using OpenSSL

To test your encoded file, decode the file using the
openssl
tool, and validate that the output matches the text in the original text file.
echo -n lM2yxKAzhe89Dti/90Z+37hqVhWbJd7tCFKXGUJtRMne2BWxM5eZ76GEouIfkKtVu4unL1TKfVfqYyViCT0PksBPl51Vy4wa21 yuCT8vw8ECmL3PSvMnyb4YHgky9ZNFKbHcCvdwjt7sLQlBZNELZFzASTHL9y2UJySdNv3ry5UWOkrrsmE5Gmf/GfBkNA8Aljkx dk/vN4quQF7zfxEWCgZry7kskHRlZgtGaUx1safyf9X9v+OQVufypzjVBFu4AAgUl5X8htBZGU1zYP0AP9e4UIKOFLlmqc744h /wMLzUATYYN8zL3k6B4bWKI3lhvMJebqz7uDbjmfCZTLTL1Q== | base64 --decode > [signature-encoded-file]
openssl rsautl -decrypt -inkey privatekey.key -in [signature-encoded-file]