1 | <?php |
||
17 | class KeyHelper |
||
18 | { |
||
19 | /** |
||
20 | * @param string $key Key content or key filename |
||
21 | * @param string $passphrase Passphrase for the private key |
||
22 | * @param bool $isFile true if $key is a filename of the key |
||
23 | * @param string $type |
||
24 | * |
||
25 | * @return XMLSecurityKey |
||
26 | */ |
||
27 | 41 | public static function createPrivateKey($key, $passphrase, $isFile = false, $type = XMLSecurityKey::RSA_SHA1) |
|
35 | |||
36 | /** |
||
37 | * @param X509Certificate $certificate |
||
38 | * |
||
39 | * @return XMLSecurityKey |
||
40 | */ |
||
41 | 30 | public static function createPublicKey(X509Certificate $certificate) |
|
51 | |||
52 | /** |
||
53 | * @param XMLSecurityKey $key |
||
54 | * @param string $algorithm |
||
55 | * |
||
56 | * @throws \LightSaml\Error\LightSamlSecurityException |
||
57 | * @throws \InvalidArgumentException |
||
58 | * |
||
59 | * @return XMLSecurityKey |
||
60 | */ |
||
61 | 1 | public static function castKey(XMLSecurityKey $key, $algorithm) |
|
85 | } |
||
86 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.