@@ 14-32 (lines=19) @@ | ||
11 | * |
|
12 | * @link https://tools.ietf.org/html/rfc7517#section-4.7 |
|
13 | */ |
|
14 | class X509CertificateChainParameter extends JWKParameter |
|
15 | { |
|
16 | use ArrayParameterValue; |
|
17 | ||
18 | /** |
|
19 | * Constructor |
|
20 | * |
|
21 | * @param string ...$certs Base64 encoded DER certificates |
|
22 | */ |
|
23 | public function __construct(...$certs) { |
|
24 | foreach ($certs as $cert) { |
|
25 | if (!Base64::isValid($cert)) { |
|
26 | throw new \UnexpectedValueException( |
|
27 | "Certificate must be base64 encoded."); |
|
28 | } |
|
29 | } |
|
30 | parent::__construct(self::PARAM_X509_CERTIFICATE_CHAIN, $certs); |
|
31 | } |
|
32 | } |
|
33 |
@@ 14-32 (lines=19) @@ | ||
11 | * |
|
12 | * @link https://tools.ietf.org/html/rfc7515#section-4.1.6 |
|
13 | */ |
|
14 | class X509CertificateChainParameter extends JWTParameter |
|
15 | { |
|
16 | use ArrayParameterValue; |
|
17 | ||
18 | /** |
|
19 | * Constructor |
|
20 | * |
|
21 | * @param string ...$certs Base64 encoded DER certificates |
|
22 | */ |
|
23 | public function __construct(...$certs) { |
|
24 | foreach ($certs as $cert) { |
|
25 | if (!Base64::isValid($cert)) { |
|
26 | throw new \UnexpectedValueException( |
|
27 | "Certificate must be base64 encoded."); |
|
28 | } |
|
29 | } |
|
30 | parent::__construct(self::PARAM_X509_CERTIFICATE_CHAIN, $certs); |
|
31 | } |
|
32 | } |
|
33 |