예제 #1
0
 static function RSASignature($plaintext, $url)
 {
     if (!$plaintext || !$url) {
         return '0,error001';
     }
     if (!($sign = RSA::ssoSignature($plaintext))) {
         ABase::toJson(0, 'Create signature failed');
     }
     //------------------------ CURL post
     $data = array('plaintext' => $plaintext, 'md' => $sign);
     $encoded = "";
     foreach ($data as $k => $v) {
         $encoded .= $encoded ? '&' : '';
         $encoded .= rawurlencode($k) . "=" . rawurlencode($v);
     }
     $pcontent = Func::curlPost($url, $encoded);
     return $pcontent;
 }