1 | <?php |
||
7 | class SecurityKeyPair |
||
8 | { |
||
9 | /** |
||
10 | * Private key. |
||
11 | * |
||
12 | * @var \ass\XmlSecurity\Key |
||
13 | */ |
||
14 | private $privateKey = null; |
||
15 | |||
16 | /** |
||
17 | * Public key. |
||
18 | * |
||
19 | * @var \ass\XmlSecurity\Key |
||
20 | */ |
||
21 | private $publicKey = null; |
||
22 | |||
23 | /** |
||
24 | * Add private key. |
||
25 | * |
||
26 | * @param string $encryptionType Encryption type |
||
27 | * @param string $key Private key |
||
28 | * @param boolean $keyIsFile Given key parameter is path to key file |
||
29 | * @param string $passphrase Passphrase for key |
||
30 | * |
||
31 | * @return void |
||
32 | */ |
||
33 | public function setPrivateKey($encryptionType, $key = null, $keyIsFile = true, $passphrase = null) |
||
37 | |||
38 | /** |
||
39 | * Add public key. |
||
40 | * |
||
41 | * @param string $encryptionType Encryption type |
||
42 | * @param string $key Public key |
||
43 | * @param boolean $keyIsFile Given key parameter is path to key file |
||
44 | * |
||
45 | * @return void |
||
46 | */ |
||
47 | public function setPublicKey($encryptionType, $key = null, $keyIsFile = true) |
||
51 | |||
52 | /** |
||
53 | * Get private key. |
||
54 | * |
||
55 | * @return \ass\XmlSecurity\Key |
||
56 | */ |
||
57 | public function getPrivateKey() |
||
61 | |||
62 | /** |
||
63 | * Get public key. |
||
64 | * |
||
65 | * @return \ass\XmlSecurity\Key |
||
66 | */ |
||
67 | public function getPublicKey() |
||
71 | |||
72 | /** |
||
73 | * Has private and public key? |
||
74 | * |
||
75 | * @return boolean |
||
76 | */ |
||
77 | public function hasKeys() |
||
81 | |||
82 | /** |
||
83 | * Has private key? |
||
84 | * |
||
85 | * @return boolean |
||
86 | */ |
||
87 | public function hasPrivateKey() |
||
91 | |||
92 | /** |
||
93 | * Has public key? |
||
94 | * |
||
95 | * @return boolean |
||
96 | */ |
||
97 | public function hasPublicKey() |
||
101 | } |
||
102 |