@@ 76-85 (lines=10) @@ | ||
73 | * @throws \UnexpectedValueException If a key cannot be found |
|
74 | * @return KeyManagementAlgorithm |
|
75 | */ |
|
76 | public function algoByKeys(JWKSet $set) { |
|
77 | if (!$this->_header->hasKeyID()) { |
|
78 | throw new \UnexpectedValueException("No key ID paremeter."); |
|
79 | } |
|
80 | $id = $this->_header->keyID()->value(); |
|
81 | if (!$set->hasKeyID($id)) { |
|
82 | throw new \UnexpectedValueException("No key for ID '$id'."); |
|
83 | } |
|
84 | return $this->algoByKey($set->keyByID($id)); |
|
85 | } |
|
86 | ||
87 | /** |
|
88 | * Get the algorithm implementation class name by an algorithm name. |
@@ 73-82 (lines=10) @@ | ||
70 | * @throws \UnexpectedValueException If a key cannot be found |
|
71 | * @return SignatureAlgorithm |
|
72 | */ |
|
73 | public function algoByKeys(JWKSet $set) { |
|
74 | if (!$this->_header->hasKeyID()) { |
|
75 | throw new \UnexpectedValueException("No key ID paremeter."); |
|
76 | } |
|
77 | $id = $this->_header->keyID()->value(); |
|
78 | if (!$set->hasKeyID($id)) { |
|
79 | throw new \UnexpectedValueException("No key for ID '$id'."); |
|
80 | } |
|
81 | return $this->algoByKey($set->keyByID($id)); |
|
82 | } |
|
83 | ||
84 | /** |
|
85 | * Get the algorithm implementation class name by an algorithm name. |