1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* This file is part of the tiqr project. |
4
|
|
|
* |
5
|
|
|
* The tiqr project aims to provide an open implementation for |
6
|
|
|
* authentication using mobile devices. It was initiated by |
7
|
|
|
* SURFnet and developed by Egeniq. |
8
|
|
|
* |
9
|
|
|
* More information: http://www.tiqr.org |
10
|
|
|
* |
11
|
|
|
* @author Ivo Jansch <[email protected]> |
12
|
|
|
* |
13
|
|
|
* @package tiqr |
14
|
|
|
* |
15
|
|
|
* @license New BSD License - See LICENSE file for details. |
16
|
|
|
* |
17
|
|
|
* @copyright (C) 2010-2012 SURFnet BV |
18
|
|
|
*/ |
19
|
|
|
|
20
|
1 |
|
require_once("Tiqr/OcraService/Interface.php"); |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* The abstract class that defines what a ocra service class should implement. |
24
|
|
|
* |
25
|
|
|
* @author lineke |
26
|
|
|
* |
27
|
|
|
*/ |
28
|
|
|
abstract class Tiqr_OcraService_Abstract implements Tiqr_OcraService_Interface |
29
|
|
|
{ |
30
|
|
|
/** |
31
|
|
|
* Verify the response |
32
|
|
|
* Override in child class to implement this method if this is the verification method to use |
33
|
|
|
* |
34
|
|
|
* @param string $response |
35
|
|
|
* @param string $userSecret |
36
|
|
|
* @param string $challenge |
37
|
|
|
* @param string $sessionKey |
38
|
|
|
* |
39
|
|
|
* @return boolean True if response matches, false otherwise |
40
|
|
|
*/ |
41
|
|
|
public function verifyResponseWithSecret($response, $userSecret, $challenge, $sessionKey) |
42
|
|
|
{ |
43
|
|
|
|
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* Verify the response |
48
|
|
|
* Override in child class to implement this method if this is the verification method to use |
49
|
|
|
* |
50
|
|
|
* @param string $response |
51
|
|
|
* @param string $userId |
52
|
|
|
* @param string $challenge |
53
|
|
|
* @param string $sessionKey |
54
|
|
|
* |
55
|
|
|
* @return boolean True if response matches, false otherwise |
56
|
|
|
*/ |
57
|
|
|
public function verifyResponseWithUserId($response, $userId, $challenge, $sessionKey) |
58
|
|
|
{ |
59
|
|
|
|
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* Returns which method name to use to verify the response (verifyResponseWithSecret or verifyResponseWithUserId) |
64
|
|
|
* |
65
|
|
|
* @return string |
66
|
|
|
*/ |
67
|
1 |
|
public function getVerificationMethodName() |
68
|
|
|
{ |
69
|
1 |
|
return 'verifyResponseWithSecret'; |
70
|
|
|
} |
71
|
|
|
} |