/** * @param string $alg * @param string $use * @param string $kid * @throws InvalidJWKAlgorithm */ public function __construct($alg = JSONWebSignatureAndEncryptionAlgorithms::RS256, $use = JSONWebKeyPublicKeyUseValues::Signature, $kid = null) { if (!empty($alg) && !in_array($alg, RSAKeysParameters::$valid_algorithms_values)) { throw new InvalidJWKAlgorithm(sprintf('alg %s', $alg)); } parent::__construct($alg, $use, $kid); }
/** * @param string $shared_secret * @param string $alg * @param string $use * @throws InvalidJWKAlgorithm */ public function __construct($shared_secret = self::GenerateSecret, $alg = JSONWebSignatureAndEncryptionAlgorithms::HS256, $use = JSONWebKeyPublicKeyUseValues::Signature) { if (!in_array($alg, OctetSequenceKeysParameters::$valid_algorithms_values)) { throw new InvalidJWKAlgorithm(sprintf('alg %s', $alg)); } parent::__construct($alg, $use); $this->shared_secret = $shared_secret; }