1 | <?php |
||
15 | class TrustStoreLoader |
||
16 | { |
||
17 | /** |
||
18 | * Loads the currently installed ca-certificates file. |
||
19 | * The approach taken by composer/ca-bundle is to attempt |
||
20 | * to load certificates if openssl-like envvars and |
||
21 | * config values are set. |
||
22 | * |
||
23 | * If $allowFallback is false, and the bundled composer |
||
24 | * ca file is returned, an exception will be thrown. |
||
25 | * |
||
26 | * @see CaBundle::getSystemCaRootBundlePath() |
||
27 | * @param bool $allowFallback |
||
28 | * @return CertificateBundle |
||
29 | */ |
||
30 | 10 | public static function fromSystem(bool $allowFallback = true): CertificateBundle |
|
44 | |||
45 | /** |
||
46 | * Loads a trust store completely controlled by what is |
||
47 | * included in the `composer/ca-bundle` package. |
||
48 | * @return CertificateBundle |
||
49 | */ |
||
50 | 1 | public static function fromComposerBundle(): CertificateBundle |
|
54 | |||
55 | /** |
||
56 | * Load a trust store from a pem bundle file (can contain |
||
57 | * multiple certificates) |
||
58 | * |
||
59 | * @param string $file |
||
60 | * @return CertificateBundle |
||
61 | * @throws Bip70Exception |
||
62 | */ |
||
63 | 11 | public static function fromFile(string $file): CertificateBundle |
|
82 | |||
83 | /** |
||
84 | * Load a trust store from a pem bundle file (can contain |
||
85 | * multiple certificates) |
||
86 | * |
||
87 | * @param string $dir |
||
88 | * @return CertificateBundle |
||
89 | * @throws Bip70Exception |
||
90 | */ |
||
91 | 4 | public static function fromDirectory(string $dir): CertificateBundle |
|
114 | } |
||
115 |