JSON Web Signature User Interface Configuration
Edit me
It is possible to set up and manage the JWS via the User Interface (as described in this section) or alternatively, this may be done via REST.
Generating the PKI Key and Certificate via the UI
Note: You will require access to the Developer Dashboard via the Nuapay front end. Once you have logged on to Nuapay, the Developer Dashboard link is available on the top right of the screen. Click this to launch the dashboard.
To generate your private key and certificate:
- Navigate to the ‘PKI Management’ screen on the Developer Dashboard. (If you cannot see this as a menu option please contact your Account Manager - specific permissions must be enabled to allow you to access this section of the dashboard).
- If this is the first time using this screen you will see a notification to say that no PKI key has been generated.
- Click Generate PKI Key. This will generate:
- Your Private Key
- A Signed certificate
- You will be prompted to download your private key (in .key format):
Important: This will be the only time you will be able to download this key and we will not retain it on our servers. If you need to regenerate the key for any reason you will need to revoke the certificate (see below).
Important: Ideally you should generate your public private key pair in a HSM and present the CSR to be signed over the REST endpoints. The certificate creation UI in the developer dashboard is offered as a convience tool to you
Managing Certificates via the UI
Once you have generated your PKI Key you have two available actions, you can:
- Download the certificate in .crt format. .
- Revoke your active certificate. This will invalidate the active certificate and private key, and you will no longer be able to generate JSON Web Signatures with this key and certificate. You will need to generate a new private key and certificate.
Retrieving Details from the Certificate
In order to generate the JOSE Header you’ll need to extract certain details from your certificate:
- Browse to where you downloaded your certificate (.CRT file) and double-click to view its details.
- Locate the certificate serial number section of the certificate. This is stored as a hexadecimal number and will need to be decoded.
- There are various tools available online to allow you to decode the haxadecimal value, see https://www.rapidtables.com/convert/number/hex-to-decimal.html for example. (The decoded number is the kid value that you will need to generate your Header later).
- Next, locate the subject parameters from the certificate:
- a header
- a payload
- a signature
The following details are required:
Attribute | Value | Description |
OU | Nuapay API | Organization unit, this will always be 'Nuapay API' for certificates signed by Nuapay. |
CN | a2av3py82w | Common name, the originator technical ID |
O | Nuapay | Organization, will always be 'Nuapay' for certificates signed by Nuapay. |
L | London | Locality, will always be 'London' for certificates signed by Nuapay. |
C | GB | Country Name, two letter country code will always be 'GB' for certificates signed by Nuapay. |
At this point you have gathered everything you need from the Certificate. These are the details you need to generate the JOSE Header:
Attribute | Value | Description |
alg | RS256 | Algorithm, always 'RS256' |
kid | 2496611953 | Key ID, use the decoded certificate serial number |
iat | 0 | Issued at, always '0' |
iss | "C=GB, L=London, OU=Nuapay API, O=Nuapay, CN=a2av3py82w" | Issuer, use the certificate subject parameters |
b64 | false | Base64 encoded payload, always 'false' |
crit | ["b64","iat","iss"] | Critical, always ["b64","iat","iss"] |
Use the JWS Signature Generator to create the JOSE Header.
Note: The expected JWS should use a detached payload.
Detached Payload JWS
A signed JWS encodes information in three parts separated by periods:A JWS also supports a detached format that omits the payload from the JWS:
'header..signature'
When using a detached JWS, the payload is sent as normal in the body but its not included in the JWS.