Omnipay\Alipay\Common\Signer::signWithRSA PHP Метод

signWithRSA() публичный Метод

public signWithRSA ( $privateKey, $alg = OPENSSL_ALGO_SHA1 )
    public function signWithRSA($privateKey, $alg = OPENSSL_ALGO_SHA1)
    {
        $content = $this->getContentToSign();
        $sign = $this->signContentWithRSA($content, $privateKey, $alg);
        return $sign;
    }

Usage Example

 protected function sign($params, $signType)
 {
     $signer = new Signer($params);
     $signer->setIgnores(['sign']);
     $signType = strtoupper($signType);
     if ($signType == 'RSA') {
         $sign = $signer->signWithRSA($this->getPrivateKey());
     } elseif ($signType == 'RSA2') {
         $sign = $signer->signWithRSA($this->getPrivateKey(), OPENSSL_ALGO_SHA256);
     } else {
         throw new InvalidRequestException('The signType is invalid');
     }
     return $sign;
 }
All Usage Examples Of Omnipay\Alipay\Common\Signer::signWithRSA