aboutsummaryrefslogtreecommitdiff
path: root/vendor/edu-sharing-plugin/edu-sharing-helper-base.php
diff options
context:
space:
mode:
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;
- }
-
-}