1
0

ICertificateManager.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2016, ownCloud, Inc.
  5. *
  6. * @author J0WI <J0WI@users.noreply.github.com>
  7. * @author Lukas Reschke <lukas@statuscode.ch>
  8. * @author Morris Jobke <hey@morrisjobke.de>
  9. * @author Robin Appelman <robin@icewind.nl>
  10. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. namespace OCP;
  27. /**
  28. * Manage trusted certificates
  29. * @since 8.0.0
  30. */
  31. interface ICertificateManager {
  32. /**
  33. * Returns all certificates trusted by the system
  34. *
  35. * @return \OCP\ICertificate[]
  36. * @since 8.0.0
  37. */
  38. public function listCertificates(): array;
  39. /**
  40. * @param string $certificate the certificate data
  41. * @param string $name the filename for the certificate
  42. * @return \OCP\ICertificate
  43. * @throws \Exception If the certificate could not get added
  44. * @since 8.0.0 - since 8.1.0 throws exception instead of returning false
  45. */
  46. public function addCertificate(string $certificate, string $name): \OCP\ICertificate;
  47. /**
  48. * @param string $name
  49. * @return bool
  50. * @since 8.0.0
  51. */
  52. public function removeCertificate(string $name): bool;
  53. /**
  54. * Get the path to the certificate bundle
  55. *
  56. * @return string
  57. * @since 8.0.0
  58. */
  59. public function getCertificateBundle(): string;
  60. /**
  61. * Get the full local path to the certificate bundle
  62. *
  63. * @return string
  64. * @since 9.0.0
  65. */
  66. public function getAbsoluteBundlePath(): string;
  67. }