1 | <?php |
||
12 | class CertificateBundle implements \Countable, \IteratorAggregate |
||
13 | { |
||
14 | /** |
||
15 | * Certificates. |
||
16 | * |
||
17 | * @var Certificate[] $_certs |
||
18 | */ |
||
19 | protected $_certs; |
||
20 | |||
21 | /** |
||
22 | * Constructor |
||
23 | * |
||
24 | * @param Certificate ...$certs Certificate objects |
||
25 | */ |
||
26 | 15 | public function __construct(Certificate ...$certs) { |
|
29 | |||
30 | /** |
||
31 | * Initialize from PEMs. |
||
32 | * |
||
33 | * @param PEM ...$pems PEM objects |
||
34 | * @return self |
||
35 | */ |
||
36 | 2 | public static function fromPEMs(PEM ...$pems) { |
|
43 | |||
44 | /** |
||
45 | * Initialize from PEM bundle. |
||
46 | * |
||
47 | * @param PEMBundle $pem_bundle |
||
48 | * @return self |
||
49 | */ |
||
50 | 1 | public static function fromPEMBundle(PEMBundle $pem_bundle) { |
|
53 | |||
54 | /** |
||
55 | * Get self with certificates added. |
||
56 | * |
||
57 | * @param Certificate ...$cert |
||
58 | * @return self |
||
59 | */ |
||
60 | 1 | public function withCertificates(Certificate ...$cert) { |
|
65 | |||
66 | /** |
||
67 | * Get self with certificates from PEMBundle added. |
||
68 | * |
||
69 | * @param PEMBundle $pem_bundle |
||
70 | * @return self |
||
71 | */ |
||
72 | 1 | public function withPEMBundle(PEMBundle $pem_bundle) { |
|
79 | |||
80 | /** |
||
81 | * Get self with single certificate from PEM added. |
||
82 | * |
||
83 | * @param PEM $pem |
||
84 | * @return self |
||
85 | */ |
||
86 | 1 | public function withPEM(PEM $pem) { |
|
91 | |||
92 | /** |
||
93 | * Get all certificates that have given subject key identifier. |
||
94 | * |
||
95 | * @param string $id |
||
96 | * @return Certificate[] |
||
97 | */ |
||
98 | 11 | public function allBySubjectKeyIdentifier($id) { |
|
111 | |||
112 | /** |
||
113 | * Get all certificates in a bundle. |
||
114 | * |
||
115 | * @return Certificate[] |
||
116 | */ |
||
117 | 1 | public function all() { |
|
120 | |||
121 | /** |
||
122 | * |
||
123 | * @see Countable::count() |
||
124 | * @return int |
||
125 | */ |
||
126 | 4 | public function count() { |
|
129 | |||
130 | /** |
||
131 | * Get iterator for certificates. |
||
132 | * |
||
133 | * @see IteratorAggregate::getIterator() |
||
134 | * @return \ArrayIterator |
||
135 | */ |
||
136 | 1 | public function getIterator() { |
|
139 | } |
||
140 |