JwkParameter uses ConstantsTrait
Enumeration of JSON Web Key (JWK) member names.
Centralises the member names used when building, parsing or validating a JWK and a JWK Set (JWKS). Members fall into three groups:
- Common metadata — present on any key type (RFC 7517 §4):
kty,use,key_ops,alg,kid,x5u,x5c,x5t,x5t#S256. - Key-type-specific values — the actual key material, whose presence depends on JwkKeyType (RFC 7518 §6, RFC 8037 §2).
- JWK Set — the
keysarray wrapping a set of JWKs (RFC 7517 §5).
Example:
$jwk =
[
JwkParameter::KTY => JwkKeyType::RSA ,
JwkParameter::USE => JwkUse::SIG ,
JwkParameter::KID => $keyId ,
JwkParameter::N => $modulus ,
JwkParameter::E => $exponent ,
] ;
References:
- RFC 7517 §4 — common JWK parameters
- RFC 7517 §5 — JWK Set (
keys) - RFC 7518 §6 —
EC,RSA,octkey parameters - RFC 8037 §2 —
OKPkey parameters - IANA JSON Web Key Parameters registry
Tags
Table of Contents
Constants
- ALG : string = 'alg'
- `alg` — Algorithm intended for use with the key (RFC 7517 §4.4). See {@see JwtAlgorithm}.
- CRV : string = 'crv'
- `crv` — Curve (RFC 7518 §6.2.1.1, RFC 8037 §2). See {@see JwkCurve}.
- D : string = 'd'
- `d` — Private key value (EC §6.2.2.1, OKP RFC 8037, RSA private exponent §6.3.2.1).
- DP : string = 'dp'
- `dp` — First factor CRT exponent (RFC 7518 §6.3.2.4).
- DQ : string = 'dq'
- `dq` — Second factor CRT exponent (RFC 7518 §6.3.2.5).
- E : string = 'e'
- `e` — Public exponent (RFC 7518 §6.3.1.2).
- K : string = 'k'
- `k` — Key value for an octet sequence (symmetric) key (RFC 7518 §6.4.1).
- KEY_OPS : string = 'key_ops'
- `key_ops` — Key Operations (RFC 7517 §4.3). See {@see JwkKeyOperation}.
- KEYS : string = 'keys'
- `keys` — Array of JWKs forming a JWK Set (RFC 7517 §5.1).
- KID : string = 'kid'
- `kid` — Key ID (RFC 7517 §4.5).
- KTY : string = 'kty'
- `kty` — Key Type (RFC 7517 §4.1). See {@see JwkKeyType}.
- N : string = 'n'
- `n` — Modulus (RFC 7518 §6.3.1.1).
- OTH : string = 'oth'
- `oth` — Other primes info, for keys with more than two primes (RFC 7518 §6.3.2.7).
- P : string = 'p'
- `p` — First prime factor (RFC 7518 §6.3.2.2).
- Q : string = 'q'
- `q` — Second prime factor (RFC 7518 §6.3.2.3).
- QI : string = 'qi'
- `qi` — First CRT coefficient (RFC 7518 §6.3.2.6).
- USE : string = 'use'
- `use` — Public Key Use, `sig` or `enc` (RFC 7517 §4.2). See {@see JwkUse}.
- X : string = 'x'
- `x` — X coordinate / public key (RFC 7518 §6.2.1.2, RFC 8037 §2).
- X5C : string = 'x5c'
- `x5c` — X.509 Certificate Chain (RFC 7517 §4.7).
- X5T : string = 'x5t'
- `x5t` — X.509 Certificate SHA-1 Thumbprint (RFC 7517 §4.8).
- X5T_S256 : string = 'x5t#S256'
- `x5t#S256` — X.509 Certificate SHA-256 Thumbprint (RFC 7517 §4.9).
- X5U : string = 'x5u'
- `x5u` — X.509 URL (RFC 7517 §4.6).
- Y : string = 'y'
- `y` — Y coordinate, EC keys only (RFC 7518 §6.2.1.3).
Constants
ALG
`alg` — Algorithm intended for use with the key (RFC 7517 §4.4). See {@see JwtAlgorithm}.
public
string
ALG
= 'alg'
CRV
`crv` — Curve (RFC 7518 §6.2.1.1, RFC 8037 §2). See {@see JwkCurve}.
public
string
CRV
= 'crv'
D
`d` — Private key value (EC §6.2.2.1, OKP RFC 8037, RSA private exponent §6.3.2.1).
public
string
D
= 'd'
DP
`dp` — First factor CRT exponent (RFC 7518 §6.3.2.4).
public
string
DP
= 'dp'
DQ
`dq` — Second factor CRT exponent (RFC 7518 §6.3.2.5).
public
string
DQ
= 'dq'
E
`e` — Public exponent (RFC 7518 §6.3.1.2).
public
string
E
= 'e'
K
`k` — Key value for an octet sequence (symmetric) key (RFC 7518 §6.4.1).
public
string
K
= 'k'
KEY_OPS
`key_ops` — Key Operations (RFC 7517 §4.3). See {@see JwkKeyOperation}.
public
string
KEY_OPS
= 'key_ops'
KEYS
`keys` — Array of JWKs forming a JWK Set (RFC 7517 §5.1).
public
string
KEYS
= 'keys'
KID
`kid` — Key ID (RFC 7517 §4.5).
public
string
KID
= 'kid'
KTY
`kty` — Key Type (RFC 7517 §4.1). See {@see JwkKeyType}.
public
string
KTY
= 'kty'
N
`n` — Modulus (RFC 7518 §6.3.1.1).
public
string
N
= 'n'
OTH
`oth` — Other primes info, for keys with more than two primes (RFC 7518 §6.3.2.7).
public
string
OTH
= 'oth'
P
`p` — First prime factor (RFC 7518 §6.3.2.2).
public
string
P
= 'p'
Q
`q` — Second prime factor (RFC 7518 §6.3.2.3).
public
string
Q
= 'q'
QI
`qi` — First CRT coefficient (RFC 7518 §6.3.2.6).
public
string
QI
= 'qi'
USE
`use` — Public Key Use, `sig` or `enc` (RFC 7517 §4.2). See {@see JwkUse}.
public
string
USE
= 'use'
X
`x` — X coordinate / public key (RFC 7518 §6.2.1.2, RFC 8037 §2).
public
string
X
= 'x'
X5C
`x5c` — X.509 Certificate Chain (RFC 7517 §4.7).
public
string
X5C
= 'x5c'
X5T
`x5t` — X.509 Certificate SHA-1 Thumbprint (RFC 7517 §4.8).
public
string
X5T
= 'x5t'
X5T_S256
`x5t#S256` — X.509 Certificate SHA-256 Thumbprint (RFC 7517 §4.9).
public
string
X5T_S256
= 'x5t#S256'
X5U
`x5u` — X.509 URL (RFC 7517 §4.6).
public
string
X5U
= 'x5u'
Y
`y` — Y coordinate, EC keys only (RFC 7518 §6.2.1.3).
public
string
Y
= 'y'