GET
/
jwe
/
key
curl --request GET \
  --url https://development.knotapi.com/jwe/key \
  --header 'Authorization: Basic <encoded-value>'
{
  "alg": "RSA-OAEP-256",
  "e": "...",
  "key_ops": [
    "encrypt"
  ],
  "kid": "...",
  "kty": "RSA",
  "n": "...",
  "use": "enc"
}

Building the JWE

You can encrypt the payload you’ll provide to the Switch Card (JWE) endpoint using your JWE public key. The JWE specifications are the following:

  1. RSA 2048 certificate in JWK format

  2. RSA-OAEP-256 as key encryption algorithm

  3. A256GCM as content encryption algorithm

The JWE value should be a JSON string with the following structure:

{
    "user": {
        "name": {
            "first_name": "Ada",
            "last_name": "Lovelace"
        },
        "address": {
            "street": "100 Main Street",
            "street2": "#100",
            "city": "NEW YORK",
            "region": "NY",
            "postal_code": "12345",
            "country": "US"
        },
        "phone_number": "+11234567890"
    },
    "card": {
        "number": "4242424242424242",
        "expiration": "08/2025",
        "cvv": "012"
    }
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Response

200
application/json
Successful request.
alg
string

Algorithm intended for use with the key.

Example:

"RSA-OAEP-256"

e
string

Exponent value for the RSA public key in Base64 URL format.

Example:

"..."

key_ops
string[]

Operation permitted for the key.

Example:
["encrypt"]
kid
string

Unique identifier for the kid.

Example:

"..."

kty
string

Type of key.

Example:

"RSA"

n
string

Modulus value for the RSA public key in Base64 URL format.

Example:

"..."

use
string

Intended use of the key.

Example:

"enc"