icertificatemanager.php 1.7 KB

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