Oihana PHP Enums

JwkKeyType uses ConstantsTrait

Enumeration of JSON Web Key types (the `kty` member of a JWK).

The kty parameter identifies the cryptographic algorithm family used with the key (RFC 7517 §4.1). It determines which other JWK members are expected — see JwkParameter.

Example:

$jwk =
[
    JwkParameter::KTY => JwkKeyType::EC ,
    JwkParameter::CRV => JwkCurve::P_256 ,
    JwkParameter::X   => $x ,
    JwkParameter::Y   => $y ,
] ;

References:

  • RFC 7518 §6.1 — kty values (EC, RSA, oct)
  • RFC 8037 §2 — OKP (Octet Key Pair, for Edwards / Montgomery curves)
  • IANA JSON Web Key Types registry
Tags
see
JwkCurve
JwkParameter
author

Marc Alcaraz (ekameleon)

since
1.1.0

Table of Contents

Constants

EC  : string = 'EC'
`EC` — Elliptic Curve key (RFC 7518 §6.2). Pairs with {@see JwkCurve} P-* curves.
OCT  : string = 'oct'
`oct` — Octet sequence, i.e. a symmetric key (RFC 7518 §6.4).
OKP  : string = 'OKP'
`OKP` — Octet Key Pair for Edwards / Montgomery curves (RFC 8037 §2).
RSA  : string = 'RSA'
`RSA` — RSA key (RFC 7518 §6.3).

Constants

EC

`EC` — Elliptic Curve key (RFC 7518 §6.2). Pairs with {@see JwkCurve} P-* curves.

public string EC = 'EC'

OCT

`oct` — Octet sequence, i.e. a symmetric key (RFC 7518 §6.4).

public string OCT = 'oct'

OKP

`OKP` — Octet Key Pair for Edwards / Montgomery curves (RFC 8037 §2).

public string OKP = 'OKP'

RSA

`RSA` — RSA key (RFC 7518 §6.3).

public string RSA = 'RSA'
On this page

Search results