From b708783f2ff3ecf0f1db6b761693b305376b24a1 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 21 Aug 2019 16:25:59 +0800 Subject: [PATCH] 1 --- third_party/phpcommon | 2 +- webapp/controller/PayController.class.php | 19 +------------------ 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/third_party/phpcommon b/third_party/phpcommon index 7a96316..f401b4f 160000 --- a/third_party/phpcommon +++ b/third_party/phpcommon @@ -1 +1 @@ -Subproject commit 7a9631684fdb8672d80a94dfbe9745bea2b8a556 +Subproject commit f401b4f89a47b3f4d2835a647d68ad11deac9275 diff --git a/webapp/controller/PayController.class.php b/webapp/controller/PayController.class.php index 0a76ad5..83b5b72 100644 --- a/webapp/controller/PayController.class.php +++ b/webapp/controller/PayController.class.php @@ -40,25 +40,8 @@ class PayController { return $orderid; } - private function _redPubkey() - { - $pem = "-----BEGIN PUBLIC KEY-----\n" . - chunk_split(self::PUB_KEY, 64, "\n") . - "-----END PUBLIC KEY-----\n"; - echo $pem; - return openssl_pkey_get_public($pem); - } - - private function _redPrikey() - { - $pem = "-----BEGIN RSA PRIVATE KEY-----\n" . - chunk_split(self::PRI_KEY, 64, "\n") . - "-----END RSA PRIVATE KEY-----\n"; - return openssl_pkey_get_private($pem); - } - private function _reaEncode($str) { - $prikey = $this->_redPrikey(); + $prikey = phpcommon\ReadPriKey(self::PRI_KEY); return openssl_sign($str, $sign, $prikey, OPENSSL_ALGO_SHA1) ? base64_encode($sign) : false; }