Google app engine 如何在Google App Engine中动态创建加密的PayPal按钮?
到目前为止,我已经找到了使用的for Django,但由于M2Crypto基于C库,因此无法在GAE上运行。有人有在谷歌应用程序引擎中动态创建加密贝宝按钮的工作代码吗 简而言之,我需要将下面的Ruby代码翻译成Python。这是为Ruby拍摄的Google app engine 如何在Google App Engine中动态创建加密的PayPal按钮?,google-app-engine,encryption,paypal,pkcs#7,Google App Engine,Encryption,Paypal,Pkcs#7,到目前为止,我已经找到了使用的for Django,但由于M2Crypto基于C库,因此无法在GAE上运行。有人有在谷歌应用程序引擎中动态创建加密贝宝按钮的工作代码吗 简而言之,我需要将下面的Ruby代码翻译成Python。这是为Ruby拍摄的 def self.encrypt_data(paypal_cert, my_business_cert, my_business_key, my_business_key_password, myparams
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
def self.encrypt_数据(贝宝证书、我的商业证书、我的商业密钥、,
my_business_key_password,myparams)
贝宝证书=OpenSSL::X509::Certificate.new(贝宝证书)
my_business_cert=OpenSSL::X509::Certificate.new(my_business_cert)
my_business_key=OpenSSL::PKey::RSA.new(
我的生意钥匙,
我的\u业务\u密钥\u密码)
info=“”
myparams.each_pair{| key,value | info看看这个库,它应该可以在Google应用程序引擎上工作,允许您使用RSA签名并使用DES3加密
检查文档