Skip to main content

Vault | Python SDK | JWT Endpoints

JWT Endpoints

JWT Retrieve

Vault.jwk_get(id, version)

Retrieve a key in JWK format.

optional parameters

The item ID

str | None

The key version(s).

  • all for all versions
  • num for a specific version
  • -num for the num latest versions

Response Object

A PangeaResponse where the JSON Web Key Set (JWKS) object is returned in the response.result field. Available response fields can be found in our API documentation.

response = vault.jwk_get("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5")

JWT Sign

Vault.jwt_sign(id, payload)

Sign a JSON Web Token (JWT) using a key.

required parameters

str

The JWT payload (in JSON).

optional parameters

The item ID.

Response Object

A PangeaResponse where the signed JSON Web Token (JWS) is returned in the response.result field. Available response fields can be found in our API documentation.

response = vault.jwt_sign(
    id="pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5",
    payload="{\"sub\": \"1234567890\",\"name\": \"John Doe\",\"admin\": true}"
)

JWT Verify

Vault.jwt_verify(jws)

Verify the signature of a JSON Web Token (JWT).

required parameters

str

The signed JSON Web Token (JWS).

Response Object

A PangeaResponse where the signature is valid is returned in the response.result field. Available response fields can be found in our API documentation.

response = vault.jwt_verify(jws="ewogICJhbGciO...")