diff --git a/composer.json b/composer.json index 42155c7..dacd684 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,8 @@ "nette/utils": "^4.0", "eventsauce/object-hydrator": "^1.4", "symfony/options-resolver": "^7.1", - "symfony/dom-crawler": "^7.1" + "symfony/dom-crawler": "^7.1", + "phpseclib/phpseclib": "~2.0" }, "require-dev": { "php-http/curl-client": "^2.3", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 09bd621..aab4991 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,6 +1,2 @@ parameters: - ignoreErrors: - - - message: "#^Parameter \\#2 \\$length of function str_split expects int\\<1, max\\>, int given\\.$#" - count: 1 - path: src/Encryption/Encrypter.php + ignoreErrors: [] diff --git a/src/Encryption/Encrypter.php b/src/Encryption/Encrypter.php index 7339402..c20a8f1 100644 --- a/src/Encryption/Encrypter.php +++ b/src/Encryption/Encrypter.php @@ -2,36 +2,24 @@ namespace IPay\Encryption; -const IPAY_PUBLIC_KEY = <<loadKey(static::IPAY_PUBLIC_KEY); - return base64_encode($result); + return base64_encode($rsa->encrypt($message)); } }