aboutsummaryrefslogtreecommitdiff
path: root/vendor/edu-sharing-plugin/edu-sharing-helper-base.php
diff options
context:
space:
mode:
authorPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
committerPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
commit4459dd7917f4d1c34f40bb68f0e991e9c3d53e4c (patch)
tree5c07151ae61276d334e88f6309c30d439a85c12e /vendor/edu-sharing-plugin/edu-sharing-helper-base.php
parentda0022e5c1abbf9825ae76debaabdff7e8623bb4 (diff)
parent97a188592c679890a25c37ab78463add76a52ff7 (diff)
Merge branch 'main' into issue-3911issue-3911
Diffstat (limited to 'vendor/edu-sharing-plugin/edu-sharing-helper-base.php')
-rw-r--r--vendor/edu-sharing-plugin/edu-sharing-helper-base.php45
1 files changed, 0 insertions, 45 deletions
diff --git a/vendor/edu-sharing-plugin/edu-sharing-helper-base.php b/vendor/edu-sharing-plugin/edu-sharing-helper-base.php
deleted file mode 100644
index 4c6f6da..0000000
--- a/vendor/edu-sharing-plugin/edu-sharing-helper-base.php
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-
-class EduSharingHelperBase {
- public $baseUrl;
- public $privateKey;
- public $appId;
- public $language = 'de';
- public $http_proxy = '';
-
- /**
- * @param string $baseUrl
- * The base url to your repository in the format "http://<host>/edu-sharing"
- * @param string $privateKey
- * Your app's private key. This must match the public key registered in the repo
- * @param string $appId
- * Your app id name (as registered in the edu-sharing repository)
- */
- public function __construct(
- string $baseUrl,
- string $privateKey,
- string $appId,
- string $http_proxy = ''
- ) {
- if(!preg_match('/^([a-z]|[A-Z]|[0-9]|[-_])+$/', $appId)) {
- throw new Exception('The given app id contains invalid characters or symbols');
- }
- $this->baseUrl=$baseUrl;
- $this->privateKey=$privateKey;
- $this->appId=$appId;
- $this->http_proxy = $http_proxy;
- }
-
- public function setLanguage(string $language) {
- $this->language = $language;
- }
-
- function sign(string $toSign) {
- $pkeyid = openssl_get_privatekey($this->privateKey);
- openssl_sign($toSign, $signature, $pkeyid);
- $signature = base64_encode($signature);
- openssl_free_key($pkeyid);
- return $signature;
- }
-
-}