1
0

ICertificateManager.php 2.1 KB

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