コード例 #1
0
 /**
  * @return Registration
  */
 public function getMatchingRegistration(SignResponse $response)
 {
     foreach ($this->registrations as $registration) {
         if ($registration->getKeyHandle() === $response->getKeyHandle()) {
             return $registration;
         }
     }
     throw new RegistrationException('No matching Registration found.', IException::ERR_NO_MATCHING_REGISTRATION);
 }
コード例 #2
0
 /**
  * @return SignRequest
  */
 public function getMatchingRequest(SignResponse $response)
 {
     foreach ($this->requests as $request) {
         if ($request->getKeyHandle() === $response->getKeyHandle() && $request->getChallenge() === $response->getChallenge()) {
             return $request;
         }
     }
     throw new SignRequestException('No matching request found.', IException::ERR_NO_MATCHING_REQUEST);
 }
コード例 #3
0
ファイル: Server.php プロジェクト: lookyman/u2f
 /**
  * @return string
  */
 private function getAuthenticateVerificationData(SignRequest $request, SignResponse $response)
 {
     return sprintf('%s%s%s', hash('sha256', $request->getAppId(), TRUE), $response->getSignaturePrefix(), hash('sha256', $response->getClientData(), TRUE));
 }