@@ -11,15 +11,15 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class KeyIDParameter extends JWTParameter |
| 13 | 13 | { |
| 14 | - use StringParameterValue; |
|
| 14 | + use StringParameterValue; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Constructor. |
|
| 18 | - * |
|
| 19 | - * @param string $id |
|
| 20 | - */ |
|
| 21 | - public function __construct($id) |
|
| 22 | - { |
|
| 23 | - parent::__construct(self::PARAM_KEY_ID, (string) $id); |
|
| 24 | - } |
|
| 16 | + /** |
|
| 17 | + * Constructor. |
|
| 18 | + * |
|
| 19 | + * @param string $id |
|
| 20 | + */ |
|
| 21 | + public function __construct($id) |
|
| 22 | + { |
|
| 23 | + parent::__construct(self::PARAM_KEY_ID, (string) $id); |
|
| 24 | + } |
|
| 25 | 25 | } |
@@ -11,15 +11,15 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class TypeParameter extends JWTParameter |
| 13 | 13 | { |
| 14 | - use StringParameterValue; |
|
| 14 | + use StringParameterValue; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Constructor. |
|
| 18 | - * |
|
| 19 | - * @param string $type |
|
| 20 | - */ |
|
| 21 | - public function __construct($type) |
|
| 22 | - { |
|
| 23 | - parent::__construct(self::PARAM_TYPE, (string) $type); |
|
| 24 | - } |
|
| 16 | + /** |
|
| 17 | + * Constructor. |
|
| 18 | + * |
|
| 19 | + * @param string $type |
|
| 20 | + */ |
|
| 21 | + public function __construct($type) |
|
| 22 | + { |
|
| 23 | + parent::__construct(self::PARAM_TYPE, (string) $type); |
|
| 24 | + } |
|
| 25 | 25 | } |
@@ -11,17 +11,17 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class X509CertificateSHA256ThumbprintParameter extends JWTParameter |
| 13 | 13 | { |
| 14 | - use Base64URLValue; |
|
| 14 | + use Base64URLValue; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Constructor. |
|
| 18 | - * |
|
| 19 | - * @param string $thumbprint Base64url encoded SHA-256 hash |
|
| 20 | - */ |
|
| 21 | - public function __construct($thumbprint) |
|
| 22 | - { |
|
| 23 | - $this->_validateEncoding($thumbprint); |
|
| 24 | - parent::__construct(self::PARAM_X509_CERTIFICATE_SHA256_THUMBPRINT, |
|
| 25 | - (string) $thumbprint); |
|
| 26 | - } |
|
| 16 | + /** |
|
| 17 | + * Constructor. |
|
| 18 | + * |
|
| 19 | + * @param string $thumbprint Base64url encoded SHA-256 hash |
|
| 20 | + */ |
|
| 21 | + public function __construct($thumbprint) |
|
| 22 | + { |
|
| 23 | + $this->_validateEncoding($thumbprint); |
|
| 24 | + parent::__construct(self::PARAM_X509_CERTIFICATE_SHA256_THUMBPRINT, |
|
| 25 | + (string) $thumbprint); |
|
| 26 | + } |
|
| 27 | 27 | } |
@@ -11,15 +11,15 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class X509URLParameter extends JWTParameter |
| 13 | 13 | { |
| 14 | - use StringParameterValue; |
|
| 14 | + use StringParameterValue; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Constructor. |
|
| 18 | - * |
|
| 19 | - * @param string $uri |
|
| 20 | - */ |
|
| 21 | - public function __construct($uri) |
|
| 22 | - { |
|
| 23 | - parent::__construct(self::PARAM_X509_URL, (string) $uri); |
|
| 24 | - } |
|
| 16 | + /** |
|
| 17 | + * Constructor. |
|
| 18 | + * |
|
| 19 | + * @param string $uri |
|
| 20 | + */ |
|
| 21 | + public function __construct($uri) |
|
| 22 | + { |
|
| 23 | + parent::__construct(self::PARAM_X509_URL, (string) $uri); |
|
| 24 | + } |
|
| 25 | 25 | } |
@@ -13,121 +13,121 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | class JWTParameter extends Parameter |
| 15 | 15 | { |
| 16 | - // registered parameter names |
|
| 17 | - const PARAM_ALGORITHM = "alg"; |
|
| 18 | - const PARAM_JWK_SET_URL = "jku"; |
|
| 19 | - const PARAM_JSON_WEB_KEY = "jwk"; |
|
| 20 | - const PARAM_KEY_ID = "kid"; |
|
| 21 | - const PARAM_X509_URL = "x5u"; |
|
| 22 | - const PARAM_X509_CERTIFICATE_CHAIN = "x5c"; |
|
| 23 | - const PARAM_X509_CERTIFICATE_SHA1_THUMBPRINT = "x5t"; |
|
| 24 | - const PARAM_X509_CERTIFICATE_SHA256_THUMBPRINT = "x5t#S256"; |
|
| 25 | - const PARAM_TYPE = "typ"; |
|
| 26 | - const PARAM_CONTENT_TYPE = "cty"; |
|
| 27 | - const PARAM_CRITICAL = "crit"; |
|
| 28 | - const PARAM_ENCRYPTION_ALGORITHM = "enc"; |
|
| 29 | - const PARAM_COMPRESSION_ALGORITHM = "zip"; |
|
| 30 | - const PARAM_EPHEMERAL_PUBLIC_KEY = "epk"; |
|
| 31 | - const PARAM_AGREEMENT_PARTYUINFO = "apu"; |
|
| 32 | - const PARAM_AGREEMENT_PARTYVINFO = "apv"; |
|
| 33 | - const PARAM_INITIALIZATION_VECTOR = "iv"; |
|
| 34 | - const PARAM_AUTHENTICATION_TAG = "tag"; |
|
| 35 | - const PARAM_PBES2_SALT_INPUT = "p2s"; |
|
| 36 | - const PARAM_PBES2_COUNT = "p2c"; |
|
| 37 | - const PARAM_BASE64URL_ENCODE_PAYLOAD = "b64"; |
|
| 16 | + // registered parameter names |
|
| 17 | + const PARAM_ALGORITHM = "alg"; |
|
| 18 | + const PARAM_JWK_SET_URL = "jku"; |
|
| 19 | + const PARAM_JSON_WEB_KEY = "jwk"; |
|
| 20 | + const PARAM_KEY_ID = "kid"; |
|
| 21 | + const PARAM_X509_URL = "x5u"; |
|
| 22 | + const PARAM_X509_CERTIFICATE_CHAIN = "x5c"; |
|
| 23 | + const PARAM_X509_CERTIFICATE_SHA1_THUMBPRINT = "x5t"; |
|
| 24 | + const PARAM_X509_CERTIFICATE_SHA256_THUMBPRINT = "x5t#S256"; |
|
| 25 | + const PARAM_TYPE = "typ"; |
|
| 26 | + const PARAM_CONTENT_TYPE = "cty"; |
|
| 27 | + const PARAM_CRITICAL = "crit"; |
|
| 28 | + const PARAM_ENCRYPTION_ALGORITHM = "enc"; |
|
| 29 | + const PARAM_COMPRESSION_ALGORITHM = "zip"; |
|
| 30 | + const PARAM_EPHEMERAL_PUBLIC_KEY = "epk"; |
|
| 31 | + const PARAM_AGREEMENT_PARTYUINFO = "apu"; |
|
| 32 | + const PARAM_AGREEMENT_PARTYVINFO = "apv"; |
|
| 33 | + const PARAM_INITIALIZATION_VECTOR = "iv"; |
|
| 34 | + const PARAM_AUTHENTICATION_TAG = "tag"; |
|
| 35 | + const PARAM_PBES2_SALT_INPUT = "p2s"; |
|
| 36 | + const PARAM_PBES2_COUNT = "p2c"; |
|
| 37 | + const PARAM_BASE64URL_ENCODE_PAYLOAD = "b64"; |
|
| 38 | 38 | |
| 39 | - // shorthand aliases for parameter names |
|
| 40 | - const P_ALG = self::PARAM_ALGORITHM; |
|
| 41 | - const P_JKU = self::PARAM_JWK_SET_URL; |
|
| 42 | - const P_JWK = self::PARAM_JSON_WEB_KEY; |
|
| 43 | - const P_KID = self::PARAM_KEY_ID; |
|
| 44 | - const P_X5U = self::PARAM_X509_URL; |
|
| 45 | - const P_X5C = self::PARAM_X509_CERTIFICATE_CHAIN; |
|
| 46 | - const P_X5T = self::PARAM_X509_CERTIFICATE_SHA1_THUMBPRINT; |
|
| 47 | - const P_X5TS256 = self::PARAM_X509_CERTIFICATE_SHA256_THUMBPRINT; |
|
| 48 | - const P_TYP = self::PARAM_TYPE; |
|
| 49 | - const P_CTY = self::PARAM_CONTENT_TYPE; |
|
| 50 | - const P_CRIT = self::PARAM_CRITICAL; |
|
| 51 | - const P_ENC = self::PARAM_ENCRYPTION_ALGORITHM; |
|
| 52 | - const P_ZIP = self::PARAM_COMPRESSION_ALGORITHM; |
|
| 53 | - const P_EPK = self::PARAM_EPHEMERAL_PUBLIC_KEY; |
|
| 54 | - const P_APU = self::PARAM_AGREEMENT_PARTYUINFO; |
|
| 55 | - const P_APV = self::PARAM_AGREEMENT_PARTYVINFO; |
|
| 56 | - const P_IV = self::PARAM_INITIALIZATION_VECTOR; |
|
| 57 | - const P_TAG = self::PARAM_AUTHENTICATION_TAG; |
|
| 58 | - const P_P2S = self::PARAM_PBES2_SALT_INPUT; |
|
| 59 | - const P_P2C = self::PARAM_PBES2_COUNT; |
|
| 60 | - const P_B64 = self::PARAM_BASE64URL_ENCODE_PAYLOAD; |
|
| 39 | + // shorthand aliases for parameter names |
|
| 40 | + const P_ALG = self::PARAM_ALGORITHM; |
|
| 41 | + const P_JKU = self::PARAM_JWK_SET_URL; |
|
| 42 | + const P_JWK = self::PARAM_JSON_WEB_KEY; |
|
| 43 | + const P_KID = self::PARAM_KEY_ID; |
|
| 44 | + const P_X5U = self::PARAM_X509_URL; |
|
| 45 | + const P_X5C = self::PARAM_X509_CERTIFICATE_CHAIN; |
|
| 46 | + const P_X5T = self::PARAM_X509_CERTIFICATE_SHA1_THUMBPRINT; |
|
| 47 | + const P_X5TS256 = self::PARAM_X509_CERTIFICATE_SHA256_THUMBPRINT; |
|
| 48 | + const P_TYP = self::PARAM_TYPE; |
|
| 49 | + const P_CTY = self::PARAM_CONTENT_TYPE; |
|
| 50 | + const P_CRIT = self::PARAM_CRITICAL; |
|
| 51 | + const P_ENC = self::PARAM_ENCRYPTION_ALGORITHM; |
|
| 52 | + const P_ZIP = self::PARAM_COMPRESSION_ALGORITHM; |
|
| 53 | + const P_EPK = self::PARAM_EPHEMERAL_PUBLIC_KEY; |
|
| 54 | + const P_APU = self::PARAM_AGREEMENT_PARTYUINFO; |
|
| 55 | + const P_APV = self::PARAM_AGREEMENT_PARTYVINFO; |
|
| 56 | + const P_IV = self::PARAM_INITIALIZATION_VECTOR; |
|
| 57 | + const P_TAG = self::PARAM_AUTHENTICATION_TAG; |
|
| 58 | + const P_P2S = self::PARAM_PBES2_SALT_INPUT; |
|
| 59 | + const P_P2C = self::PARAM_PBES2_COUNT; |
|
| 60 | + const P_B64 = self::PARAM_BASE64URL_ENCODE_PAYLOAD; |
|
| 61 | 61 | |
| 62 | - /** |
|
| 63 | - * Mapping from registered JWT parameter name to class name. |
|
| 64 | - * |
|
| 65 | - * @internal |
|
| 66 | - * |
|
| 67 | - * @var array |
|
| 68 | - */ |
|
| 69 | - const MAP_NAME_TO_CLASS = array( |
|
| 70 | - /* @formatter:off */ |
|
| 71 | - self::P_ALG => AlgorithmParameter::class, |
|
| 72 | - self::P_JKU => JWKSetURLParameter::class, |
|
| 73 | - self::P_JWK => JSONWebKeyParameter::class, |
|
| 74 | - self::P_KID => KeyIDParameter::class, |
|
| 75 | - self::P_X5U => X509URLParameter::class, |
|
| 76 | - self::P_X5C => X509CertificateChainParameter::class, |
|
| 77 | - self::P_X5T => X509CertificateSHA1ThumbprintParameter::class, |
|
| 78 | - self::P_X5TS256 => X509CertificateSHA256ThumbprintParameter::class, |
|
| 79 | - self::P_TYP => TypeParameter::class, |
|
| 80 | - self::P_CTY => ContentTypeParameter::class, |
|
| 81 | - self::P_CRIT => CriticalParameter::class, |
|
| 82 | - self::P_ENC => EncryptionAlgorithmParameter::class, |
|
| 83 | - self::P_ZIP => CompressionAlgorithmParameter::class, |
|
| 84 | - self::P_IV => InitializationVectorParameter::class, |
|
| 85 | - self::P_TAG => AuthenticationTagParameter::class, |
|
| 86 | - self::P_P2S => PBES2SaltInputParameter::class, |
|
| 87 | - self::P_P2C => PBES2CountParameter::class, |
|
| 88 | - self::P_B64 => B64PayloadParameter::class |
|
| 89 | - /* @formatter:on */ |
|
| 90 | - ); |
|
| 62 | + /** |
|
| 63 | + * Mapping from registered JWT parameter name to class name. |
|
| 64 | + * |
|
| 65 | + * @internal |
|
| 66 | + * |
|
| 67 | + * @var array |
|
| 68 | + */ |
|
| 69 | + const MAP_NAME_TO_CLASS = array( |
|
| 70 | + /* @formatter:off */ |
|
| 71 | + self::P_ALG => AlgorithmParameter::class, |
|
| 72 | + self::P_JKU => JWKSetURLParameter::class, |
|
| 73 | + self::P_JWK => JSONWebKeyParameter::class, |
|
| 74 | + self::P_KID => KeyIDParameter::class, |
|
| 75 | + self::P_X5U => X509URLParameter::class, |
|
| 76 | + self::P_X5C => X509CertificateChainParameter::class, |
|
| 77 | + self::P_X5T => X509CertificateSHA1ThumbprintParameter::class, |
|
| 78 | + self::P_X5TS256 => X509CertificateSHA256ThumbprintParameter::class, |
|
| 79 | + self::P_TYP => TypeParameter::class, |
|
| 80 | + self::P_CTY => ContentTypeParameter::class, |
|
| 81 | + self::P_CRIT => CriticalParameter::class, |
|
| 82 | + self::P_ENC => EncryptionAlgorithmParameter::class, |
|
| 83 | + self::P_ZIP => CompressionAlgorithmParameter::class, |
|
| 84 | + self::P_IV => InitializationVectorParameter::class, |
|
| 85 | + self::P_TAG => AuthenticationTagParameter::class, |
|
| 86 | + self::P_P2S => PBES2SaltInputParameter::class, |
|
| 87 | + self::P_P2C => PBES2CountParameter::class, |
|
| 88 | + self::P_B64 => B64PayloadParameter::class |
|
| 89 | + /* @formatter:on */ |
|
| 90 | + ); |
|
| 91 | 91 | |
| 92 | - /** |
|
| 93 | - * Constructor. |
|
| 94 | - * |
|
| 95 | - * @param string $name Parameter name |
|
| 96 | - * @param mixed $value Parameter value |
|
| 97 | - */ |
|
| 98 | - public function __construct($name, $value) |
|
| 99 | - { |
|
| 100 | - $this->_name = $name; |
|
| 101 | - $this->_value = $value; |
|
| 102 | - } |
|
| 92 | + /** |
|
| 93 | + * Constructor. |
|
| 94 | + * |
|
| 95 | + * @param string $name Parameter name |
|
| 96 | + * @param mixed $value Parameter value |
|
| 97 | + */ |
|
| 98 | + public function __construct($name, $value) |
|
| 99 | + { |
|
| 100 | + $this->_name = $name; |
|
| 101 | + $this->_value = $value; |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - /** |
|
| 105 | - * Initialize from a name and a value. |
|
| 106 | - * |
|
| 107 | - * Returns a parameter specific object if one is implemented. |
|
| 108 | - * |
|
| 109 | - * @param string $name Parameter name |
|
| 110 | - * @param mixed $value Parameter value |
|
| 111 | - * @return self |
|
| 112 | - */ |
|
| 113 | - public static function fromNameAndValue($name, $value) |
|
| 114 | - { |
|
| 115 | - if (array_key_exists($name, self::MAP_NAME_TO_CLASS)) { |
|
| 116 | - $cls = self::MAP_NAME_TO_CLASS[$name]; |
|
| 117 | - return $cls::fromJSONValue($value); |
|
| 118 | - } |
|
| 119 | - return new self($name, $value); |
|
| 120 | - } |
|
| 104 | + /** |
|
| 105 | + * Initialize from a name and a value. |
|
| 106 | + * |
|
| 107 | + * Returns a parameter specific object if one is implemented. |
|
| 108 | + * |
|
| 109 | + * @param string $name Parameter name |
|
| 110 | + * @param mixed $value Parameter value |
|
| 111 | + * @return self |
|
| 112 | + */ |
|
| 113 | + public static function fromNameAndValue($name, $value) |
|
| 114 | + { |
|
| 115 | + if (array_key_exists($name, self::MAP_NAME_TO_CLASS)) { |
|
| 116 | + $cls = self::MAP_NAME_TO_CLASS[$name]; |
|
| 117 | + return $cls::fromJSONValue($value); |
|
| 118 | + } |
|
| 119 | + return new self($name, $value); |
|
| 120 | + } |
|
| 121 | 121 | |
| 122 | - /** |
|
| 123 | - * Initialize from a JSON value. |
|
| 124 | - * |
|
| 125 | - * @param mixed $value |
|
| 126 | - * @return self |
|
| 127 | - */ |
|
| 128 | - public static function fromJSONValue($value) |
|
| 129 | - { |
|
| 130 | - throw new \BadMethodCallException( |
|
| 131 | - __FUNCTION__ . " must be implemented in a derived class."); |
|
| 132 | - } |
|
| 122 | + /** |
|
| 123 | + * Initialize from a JSON value. |
|
| 124 | + * |
|
| 125 | + * @param mixed $value |
|
| 126 | + * @return self |
|
| 127 | + */ |
|
| 128 | + public static function fromJSONValue($value) |
|
| 129 | + { |
|
| 130 | + throw new \BadMethodCallException( |
|
| 131 | + __FUNCTION__ . " must be implemented in a derived class."); |
|
| 132 | + } |
|
| 133 | 133 | } |
@@ -11,15 +11,15 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class JWKSetURLParameter extends JWTParameter |
| 13 | 13 | { |
| 14 | - use StringParameterValue; |
|
| 14 | + use StringParameterValue; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Constructor. |
|
| 18 | - * |
|
| 19 | - * @param string $uri |
|
| 20 | - */ |
|
| 21 | - public function __construct($uri) |
|
| 22 | - { |
|
| 23 | - parent::__construct(self::PARAM_JWK_SET_URL, (string) $uri); |
|
| 24 | - } |
|
| 16 | + /** |
|
| 17 | + * Constructor. |
|
| 18 | + * |
|
| 19 | + * @param string $uri |
|
| 20 | + */ |
|
| 21 | + public function __construct($uri) |
|
| 22 | + { |
|
| 23 | + parent::__construct(self::PARAM_JWK_SET_URL, (string) $uri); |
|
| 24 | + } |
|
| 25 | 25 | } |
@@ -11,27 +11,27 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class CompressionAlgorithmParameter extends JWTParameter |
| 13 | 13 | { |
| 14 | - use StringParameterValue; |
|
| 14 | + use StringParameterValue; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Constructor. |
|
| 18 | - * |
|
| 19 | - * @param string $algo |
|
| 20 | - */ |
|
| 21 | - public function __construct($algo) |
|
| 22 | - { |
|
| 23 | - parent::__construct(self::PARAM_COMPRESSION_ALGORITHM, (string) $algo); |
|
| 24 | - } |
|
| 16 | + /** |
|
| 17 | + * Constructor. |
|
| 18 | + * |
|
| 19 | + * @param string $algo |
|
| 20 | + */ |
|
| 21 | + public function __construct($algo) |
|
| 22 | + { |
|
| 23 | + parent::__construct(self::PARAM_COMPRESSION_ALGORITHM, (string) $algo); |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Initialize from CompressionAlgorithmParameterValue. |
|
| 28 | - * |
|
| 29 | - * @param CompressionAlgorithmParameterValue $value |
|
| 30 | - * @return self |
|
| 31 | - */ |
|
| 32 | - public static function fromAlgorithm( |
|
| 33 | - CompressionAlgorithmParameterValue $value) |
|
| 34 | - { |
|
| 35 | - return new self($value->compressionParamValue()); |
|
| 36 | - } |
|
| 26 | + /** |
|
| 27 | + * Initialize from CompressionAlgorithmParameterValue. |
|
| 28 | + * |
|
| 29 | + * @param CompressionAlgorithmParameterValue $value |
|
| 30 | + * @return self |
|
| 31 | + */ |
|
| 32 | + public static function fromAlgorithm( |
|
| 33 | + CompressionAlgorithmParameterValue $value) |
|
| 34 | + { |
|
| 35 | + return new self($value->compressionParamValue()); |
|
| 36 | + } |
|
| 37 | 37 | } |
@@ -12,26 +12,26 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class AlgorithmParameter extends JWTParameter |
| 14 | 14 | { |
| 15 | - use StringParameterValue; |
|
| 15 | + use StringParameterValue; |
|
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * Constructor. |
|
| 19 | - * |
|
| 20 | - * @param string $algo Algorithm name |
|
| 21 | - */ |
|
| 22 | - public function __construct($algo) |
|
| 23 | - { |
|
| 24 | - parent::__construct(self::PARAM_ALGORITHM, (string) $algo); |
|
| 25 | - } |
|
| 17 | + /** |
|
| 18 | + * Constructor. |
|
| 19 | + * |
|
| 20 | + * @param string $algo Algorithm name |
|
| 21 | + */ |
|
| 22 | + public function __construct($algo) |
|
| 23 | + { |
|
| 24 | + parent::__construct(self::PARAM_ALGORITHM, (string) $algo); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Initialize from AlgorithmParameterValue. |
|
| 29 | - * |
|
| 30 | - * @param AlgorithmParameterValue $value |
|
| 31 | - * @return self |
|
| 32 | - */ |
|
| 33 | - public static function fromAlgorithm(AlgorithmParameterValue $value) |
|
| 34 | - { |
|
| 35 | - return new self($value->algorithmParamValue()); |
|
| 36 | - } |
|
| 27 | + /** |
|
| 28 | + * Initialize from AlgorithmParameterValue. |
|
| 29 | + * |
|
| 30 | + * @param AlgorithmParameterValue $value |
|
| 31 | + * @return self |
|
| 32 | + */ |
|
| 33 | + public static function fromAlgorithm(AlgorithmParameterValue $value) |
|
| 34 | + { |
|
| 35 | + return new self($value->algorithmParamValue()); |
|
| 36 | + } |
|
| 37 | 37 | } |
@@ -11,37 +11,37 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class PBES2SaltInputParameter extends JWTParameter |
| 13 | 13 | { |
| 14 | - use Base64URLValue; |
|
| 14 | + use Base64URLValue; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Constructor. |
|
| 18 | - * |
|
| 19 | - * @param string $salt Base64url encoded salt input value |
|
| 20 | - */ |
|
| 21 | - public function __construct($salt) |
|
| 22 | - { |
|
| 23 | - $this->_validateEncoding($salt); |
|
| 24 | - parent::__construct(self::PARAM_PBES2_SALT_INPUT, (string) $salt); |
|
| 25 | - } |
|
| 16 | + /** |
|
| 17 | + * Constructor. |
|
| 18 | + * |
|
| 19 | + * @param string $salt Base64url encoded salt input value |
|
| 20 | + */ |
|
| 21 | + public function __construct($salt) |
|
| 22 | + { |
|
| 23 | + $this->_validateEncoding($salt); |
|
| 24 | + parent::__construct(self::PARAM_PBES2_SALT_INPUT, (string) $salt); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Get salt input value. |
|
| 29 | - * |
|
| 30 | - * @return string |
|
| 31 | - */ |
|
| 32 | - public function saltInput() |
|
| 33 | - { |
|
| 34 | - return $this->string(); |
|
| 35 | - } |
|
| 27 | + /** |
|
| 28 | + * Get salt input value. |
|
| 29 | + * |
|
| 30 | + * @return string |
|
| 31 | + */ |
|
| 32 | + public function saltInput() |
|
| 33 | + { |
|
| 34 | + return $this->string(); |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Get computed salt value. |
|
| 39 | - * |
|
| 40 | - * @param AlgorithmParameter $algo |
|
| 41 | - * @return string |
|
| 42 | - */ |
|
| 43 | - public function salt(AlgorithmParameter $algo) |
|
| 44 | - { |
|
| 45 | - return $algo->value() . "\0" . $this->saltInput(); |
|
| 46 | - } |
|
| 37 | + /** |
|
| 38 | + * Get computed salt value. |
|
| 39 | + * |
|
| 40 | + * @param AlgorithmParameter $algo |
|
| 41 | + * @return string |
|
| 42 | + */ |
|
| 43 | + public function salt(AlgorithmParameter $algo) |
|
| 44 | + { |
|
| 45 | + return $algo->value() . "\0" . $this->saltInput(); |
|
| 46 | + } |
|
| 47 | 47 | } |