PluginProbe ʕ •ᴥ•ʔ
WP 2FA – Two-factor authentication for WordPress / 2.4.2
WP 2FA – Two-factor authentication for WordPress v2.4.2
4.0.0 1.7.1 2.0.0 2.0.1 2.1.0 2.2.0 2.2.1 2.3.0 2.4.0 2.4.1 2.4.2 2.5.0 2.6.0 2.6.1 2.6.2 2.6.3 2.6.4 2.7.0 2.8.0 2.9.0 2.9.1 2.9.2 2.9.3 3.0.0 3.0.1 3.1.0 3.1.1 3.1.1.2 trunk 1.2.0 1.3.0 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.6.0 1.6.1 1.6.2 1.7.0
wp-2fa / vendor / firebase / php-jwt / src / Key.php
wp-2fa / vendor / firebase / php-jwt / src Last commit date
BeforeValidException.php 3 years ago ExpiredException.php 3 years ago JWK.php 3 years ago JWT.php 3 years ago Key.php 3 years ago SignatureInvalidException.php 3 years ago
Key.php
48 lines
1 <?php
2
3 namespace WP2FA_Vendor\Firebase\JWT;
4
5 use InvalidArgumentException;
6 use OpenSSLAsymmetricKey;
7 class Key
8 {
9 /** @var string $algorithm */
10 private $algorithm;
11 /** @var string|resource|OpenSSLAsymmetricKey $keyMaterial */
12 private $keyMaterial;
13 /**
14 * @param string|resource|OpenSSLAsymmetricKey $keyMaterial
15 * @param string $algorithm
16 */
17 public function __construct($keyMaterial, $algorithm)
18 {
19 if (!\is_string($keyMaterial) && !\is_resource($keyMaterial) && !$keyMaterial instanceof OpenSSLAsymmetricKey) {
20 throw new InvalidArgumentException('Type error: $keyMaterial must be a string, resource, or OpenSSLAsymmetricKey');
21 }
22 if (empty($keyMaterial)) {
23 throw new InvalidArgumentException('Type error: $keyMaterial must not be empty');
24 }
25 if (!\is_string($algorithm) || empty($keyMaterial)) {
26 throw new InvalidArgumentException('Type error: $algorithm must be a string');
27 }
28 $this->keyMaterial = $keyMaterial;
29 $this->algorithm = $algorithm;
30 }
31 /**
32 * Return the algorithm valid for this key
33 *
34 * @return string
35 */
36 public function getAlgorithm()
37 {
38 return $this->algorithm;
39 }
40 /**
41 * @return string|resource|OpenSSLAsymmetricKey
42 */
43 public function getKeyMaterial()
44 {
45 return $this->keyMaterial;
46 }
47 }
48