Skip to content

Commit 27cc429

Browse files
docs(security): clarify ICertificateManager API and certificate handling
Signed-off-by: Josh <josh.t.richards@gmail.com>
1 parent b5e3b96 commit 27cc429

1 file changed

Lines changed: 24 additions & 9 deletions

File tree

lib/public/ICertificateManager.php

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,52 +9,67 @@
99
namespace OCP;
1010

1111
/**
12-
* Manage trusted certificates
12+
* Manage trusted certificates and the effective CA bundle used by Nextcloud.
13+
*
14+
* Implementations provide access to uploaded trusted certificates and the
15+
* generated bundle that is consumed by HTTP clients and external storage
16+
* integrations.
17+
*
1318
* @since 8.0.0
1419
*/
1520
interface ICertificateManager {
1621
/**
17-
* Returns all certificates trusted by the system
22+
* Returns all uploaded trusted certificates.
23+
*
24+
* This does not include the shipped default CA bundle or any system CA bundle
25+
* appended when building the effective bundle.
1826
*
1927
* @return \OCP\ICertificate[]
2028
* @since 8.0.0
2129
*/
2230
public function listCertificates(): array;
2331

2432
/**
25-
* @param string $certificate the certificate data
26-
* @param string $name the filename for the certificate
33+
* Add a trusted certificate to the certificate store.
34+
*
35+
* @param string $certificate The certificate data in PEM format
36+
* @param string $name The filename for the certificate
2737
* @return \OCP\ICertificate
28-
* @throws \Exception If the certificate could not get added
38+
* @throws \Exception If the certificate could not be added
2939
* @since 8.0.0 - since 8.1.0 throws exception instead of returning false
3040
*/
3141
public function addCertificate(string $certificate, string $name): \OCP\ICertificate;
3242

3343
/**
34-
* @param string $name
44+
* Remove a trusted certificate from the certificate store.
45+
*
46+
* @param string $name The filename for the certificate
3547
* @return bool
3648
* @since 8.0.0
3749
*/
3850
public function removeCertificate(string $name): bool;
3951

4052
/**
41-
* Get the path to the certificate bundle
53+
* Get the relative path to the generated certificate bundle.
4254
*
4355
* @return string
4456
* @since 8.0.0
4557
*/
4658
public function getCertificateBundle(): string;
4759

4860
/**
49-
* Get the full local path to the certificate bundle
61+
* Get the full local path to the effective certificate bundle.
62+
*
63+
* Implementations should return the generated bundle path, but may log and fall back
64+
* to the shipped default CA bundle if resolution fails.
5065
*
5166
* @return string
5267
* @since 9.0.0
5368
*/
5469
public function getAbsoluteBundlePath(): string;
5570

5671
/**
57-
* Get the path of the default certificates bundle.
72+
* Get the path of the shipped default certificates bundle.
5873
*
5974
* @since 33.0.0
6075
*/

0 commit comments

Comments
 (0)