1
0

ICertificateManager.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  6. * SPDX-License-Identifier: AGPL-3.0-only
  7. */
  8. namespace OCP;
  9. /**
  10. * Manage trusted certificates
  11. * @since 8.0.0
  12. */
  13. interface ICertificateManager {
  14. /**
  15. * Returns all certificates trusted by the system
  16. *
  17. * @return \OCP\ICertificate[]
  18. * @since 8.0.0
  19. */
  20. public function listCertificates(): array;
  21. /**
  22. * @param string $certificate the certificate data
  23. * @param string $name the filename for the certificate
  24. * @return \OCP\ICertificate
  25. * @throws \Exception If the certificate could not get added
  26. * @since 8.0.0 - since 8.1.0 throws exception instead of returning false
  27. */
  28. public function addCertificate(string $certificate, string $name): \OCP\ICertificate;
  29. /**
  30. * @param string $name
  31. * @return bool
  32. * @since 8.0.0
  33. */
  34. public function removeCertificate(string $name): bool;
  35. /**
  36. * Get the path to the certificate bundle
  37. *
  38. * @return string
  39. * @since 8.0.0
  40. */
  41. public function getCertificateBundle(): string;
  42. /**
  43. * Get the full local path to the certificate bundle
  44. *
  45. * @return string
  46. * @since 9.0.0
  47. */
  48. public function getAbsoluteBundlePath(): string;
  49. }