1 | <?php |
||
19 | class Wsse |
||
20 | { |
||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $username; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $password; |
||
30 | |||
31 | /** |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $options; |
||
35 | |||
36 | /** |
||
37 | * The constructor class. |
||
38 | * |
||
39 | * @param string $username The username of wsse security. |
||
40 | * @param string $password The password of wsse security. |
||
41 | * @param array $options Options to encode password. |
||
42 | */ |
||
43 | public function __construct($username, $password, array $options = []) |
||
49 | |||
50 | /** |
||
51 | * Generates header for wsse security. |
||
52 | * |
||
53 | * @throws Exception If the username or password are not provided. |
||
54 | * |
||
55 | * @return array |
||
56 | */ |
||
57 | public function generateHeader() |
||
81 | |||
82 | /** |
||
83 | * Generates a random nonce for wsse token. |
||
84 | * |
||
85 | * @return string |
||
86 | */ |
||
87 | protected function generateNonce() |
||
101 | |||
102 | /** |
||
103 | * Generates a password digest. |
||
104 | * |
||
105 | * @param string $nonce The generated nonce. |
||
106 | * @param string $created The date of creation. |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | protected function generatePasswordDigest($nonce, $created) |
||
120 | } |
||
121 |