google-app-engine - 如何在 Google App Engine 中动态创建加密的 PayPal 按钮?

标签 google-app-engine encryption paypal pkcs#7

到目前为止,我找到了一个 example对于使用 M2Crypto 的 Django , 但因为 M2Crypto 是基于 C 库的,所以它不能在 GAE 上运行。有人有在 Google App Engine 中动态创建加密 PayPal 按钮的工作代码吗?

简而言之,我需要将以下 Ruby 代码翻译成 Python。它取自 PayPal's Website Payments Standard toolkit用于 ruby 。

def self.encrypt_data(paypal_cert, my_business_cert, my_business_key,
                      my_business_key_password, myparams  )     
  paypal_cert      = OpenSSL::X509::Certificate.new(paypal_cert)     
  my_business_cert = OpenSSL::X509::Certificate.new(my_business_cert)      
  my_business_key  = OpenSSL::PKey::RSA.new(
    my_business_key,
    my_business_key_password)   
  info = ""
  myparams.each_pair {|key,value| info << "#{key}=#{value}\n"}    
  signedInfo       = OpenSSL::PKCS7::sign(
    my_business_cert,
    my_business_key,
    info,
    [],
    OpenSSL::PKCS7::BINARY)
  OpenSSL::PKCS7::encrypt(
    [paypal_cert],
    signedInfo.to_der,
    OpenSSL::Cipher::Cipher::new("DES3"),
    OpenSSL::PKCS7::BINARY)           
end

最佳答案

查看Keyczar库,它应该可以在 Google App Engine 上运行,允许您使用 RSA 进行签名并使用 DES3 进行加密。

查看文档 here .

关于google-app-engine - 如何在 Google App Engine 中动态创建加密的 PayPal 按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2334536/

相关文章:

python - css 在除两个页面之外的所有页面上工作

java - ColdFusion 8 Diffie-Hellman 加密

c - 在微 Controller 上用 C 语言加密/解密小消息

java - 在 Android 中加密和解密 zip 文件?

ActiveMerchant PaypalExpress 网关 - 设置谁支付费用

java - GAE 中的 userservicefactory 是否仅适用于拥有 g-mail 帐户的用户?

google-app-engine - 我们如何远程使用 Google Datastore Objectify?

python - 通过 GAE 上的 webapp2 返回大型/流式响应?

paypal - 通过 Adaptive Payment API 进行的简单付款需要多长时间才能发送?

paypal - 与 PayPal 的每月结算周期混淆