lib/JWX/JWK/Parameter/CurveParameter.php 1 location
|
@@ 63-69 (lines=7) @@
|
| 60 |
|
* @throws \UnexpectedValueException If the curve is not supported |
| 61 |
|
* @return self |
| 62 |
|
*/ |
| 63 |
|
public static function fromOID($oid) { |
| 64 |
|
if (!array_key_exists($oid, self::MAP_OID_TO_CURVE)) { |
| 65 |
|
throw new \UnexpectedValueException("OID $oid not supported."); |
| 66 |
|
} |
| 67 |
|
$curve = self::MAP_OID_TO_CURVE[$oid]; |
| 68 |
|
return new self($curve); |
| 69 |
|
} |
| 70 |
|
|
| 71 |
|
/** |
| 72 |
|
* Get key size in bits for the curve. |
lib/JWX/JWE/EncryptionAlgorithm/EncryptionAlgorithmFactory.php 1 location
|
@@ 46-53 (lines=8) @@
|
| 43 |
|
* @throws \UnexpectedValueException If algorithm is not supported. |
| 44 |
|
* @return ContentEncryptionAlgorithm |
| 45 |
|
*/ |
| 46 |
|
public static function algoByName($name) { |
| 47 |
|
if (!array_key_exists($name, self::MAP_ALGO_TO_CLASS)) { |
| 48 |
|
throw new \UnexpectedValueException( |
| 49 |
|
"No content encryption algorithm '$name'."); |
| 50 |
|
} |
| 51 |
|
$cls = self::MAP_ALGO_TO_CLASS[$name]; |
| 52 |
|
return new $cls(); |
| 53 |
|
} |
| 54 |
|
|
| 55 |
|
/** |
| 56 |
|
* Get the content encryption algorithm as specified in the given header. |
lib/JWX/JWE/KeyAlgorithm/KeyAlgorithmFactory.php 1 location
|
@@ 94-100 (lines=7) @@
|
| 91 |
|
* @throws \UnexpectedValueException |
| 92 |
|
* @return string Class name |
| 93 |
|
*/ |
| 94 |
|
private static function _algoClassByName($alg) { |
| 95 |
|
if (!array_key_exists($alg, self::MAP_ALGO_TO_CLASS)) { |
| 96 |
|
throw new \UnexpectedValueException( |
| 97 |
|
"Algorithm '$alg' not supported."); |
| 98 |
|
} |
| 99 |
|
return self::MAP_ALGO_TO_CLASS[$alg]; |
| 100 |
|
} |
| 101 |
|
} |
| 102 |
|
|
lib/JWX/JWE/CompressionAlgorithm/CompressionFactory.php 1 location
|
@@ 35-42 (lines=8) @@
|
| 32 |
|
* @throws \UnexpectedValueException If algorithm is not supported |
| 33 |
|
* @return CompressionAlgorithm |
| 34 |
|
*/ |
| 35 |
|
public static function algoByName($name) { |
| 36 |
|
if (!array_key_exists($name, self::MAP_ALGO_TO_CLASS)) { |
| 37 |
|
throw new \UnexpectedValueException( |
| 38 |
|
"No compression algorithm '$name'."); |
| 39 |
|
} |
| 40 |
|
$cls = self::MAP_ALGO_TO_CLASS[$name]; |
| 41 |
|
return new $cls(); |
| 42 |
|
} |
| 43 |
|
|
| 44 |
|
/** |
| 45 |
|
* Get the compression algorithm as specified in the given header. |