JsonWebKey

class oci.apigateway.models.JsonWebKey(**kwargs)

Bases: StaticPublicKey

A JSON Web Key that represents the public key used for verifying the JWT signature.

Attributes:

FORMAT_JSON_WEB_KEY

A constant which can be used with the format property of a StaticPublicKey.

FORMAT_PEM

A constant which can be used with the format property of a StaticPublicKey.

KEY_OPS_VERIFY

A constant which can be used with the key_ops property of a JsonWebKey.

KTY_RSA

A constant which can be used with the kty property of a JsonWebKey.

USE_SIG

A constant which can be used with the use property of a JsonWebKey.

alg

Gets the alg of this JsonWebKey.

e

[Required] Gets the e of this JsonWebKey.

format

[Required] Gets the format of this StaticPublicKey.

key_ops

Gets the key_ops of this JsonWebKey.

kid

[Required] Gets the kid of this StaticPublicKey.

kty

[Required] Gets the kty of this JsonWebKey.

n

[Required] Gets the n of this JsonWebKey.

use

Gets the use of this JsonWebKey.

Methods:

__init__(**kwargs)

Initializes a new JsonWebKey object with values from keyword arguments.

get_subtype(object_dictionary)

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.

FORMAT_JSON_WEB_KEY = 'JSON_WEB_KEY'

A constant which can be used with the format property of a StaticPublicKey. This constant has a value of “JSON_WEB_KEY”

FORMAT_PEM = 'PEM'

A constant which can be used with the format property of a StaticPublicKey. This constant has a value of “PEM”

KEY_OPS_VERIFY = 'verify'

A constant which can be used with the key_ops property of a JsonWebKey. This constant has a value of “verify”

KTY_RSA = 'RSA'

A constant which can be used with the kty property of a JsonWebKey. This constant has a value of “RSA”

USE_SIG = 'sig'

A constant which can be used with the use property of a JsonWebKey. This constant has a value of “sig”

__init__(**kwargs)

Initializes a new JsonWebKey object with values from keyword arguments. The default value of the format attribute of this class is JSON_WEB_KEY and it should not be changed. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters
  • kid (str) – The value to assign to the kid property of this JsonWebKey.

  • format (str) – The value to assign to the format property of this JsonWebKey. Allowed values for this property are: “JSON_WEB_KEY”, “PEM”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

  • kty (str) – The value to assign to the kty property of this JsonWebKey. Allowed values for this property are: “RSA”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

  • use (str) – The value to assign to the use property of this JsonWebKey. Allowed values for this property are: “sig”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

  • key_ops (list[str]) – The value to assign to the key_ops property of this JsonWebKey. Allowed values for items in this list are: “verify”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

  • alg (str) – The value to assign to the alg property of this JsonWebKey.

  • n (str) – The value to assign to the n property of this JsonWebKey.

  • e (str) – The value to assign to the e property of this JsonWebKey.

property alg

Gets the alg of this JsonWebKey. The algorithm intended for use with this key.

Returns

The alg of this JsonWebKey.

Return type

str

property e

[Required] Gets the e of this JsonWebKey. The base64 url encoded exponent of the RSA public key represented by this key.

Returns

The e of this JsonWebKey.

Return type

str

property format

[Required] Gets the format of this StaticPublicKey. The format of the public key.

Allowed values for this property are: “JSON_WEB_KEY”, “PEM”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns

The format of this StaticPublicKey.

Return type

str

static get_subtype(object_dictionary)

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.

property key_ops

Gets the key_ops of this JsonWebKey. The operations for which this key is to be used.

Allowed values for items in this list are: “verify”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns

The key_ops of this JsonWebKey.

Return type

list[str]

property kid

[Required] Gets the kid of this StaticPublicKey. A unique key ID. This key will be used to verify the signature of a JWT with matching “kid”.

Returns

The kid of this StaticPublicKey.

Return type

str

property kty

[Required] Gets the kty of this JsonWebKey. The key type.

Allowed values for this property are: “RSA”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns

The kty of this JsonWebKey.

Return type

str

property n

[Required] Gets the n of this JsonWebKey. The base64 url encoded modulus of the RSA public key represented by this key.

Returns

The n of this JsonWebKey.

Return type

str

property use

Gets the use of this JsonWebKey. The intended use of the public key.

Allowed values for this property are: “sig”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns

The use of this JsonWebKey.

Return type

str