mirror of https://github.com/n1nj4sec/pupy.git
Convert privkey/cert to 8bit strings
Fix https://github.com/n1nj4sec/pupy/issues/682
This commit is contained in:
parent
8180edd34c
commit
645263dbb6
|
@ -8,6 +8,13 @@ from base64 import b64encode
|
||||||
|
|
||||||
def jarsigner(pem_priv, pem_cert, apk_path, dest_fileobj):
|
def jarsigner(pem_priv, pem_cert, apk_path, dest_fileobj):
|
||||||
pk = EVP.PKey()
|
pk = EVP.PKey()
|
||||||
|
|
||||||
|
if type(pem_priv) == unicode:
|
||||||
|
pem_priv = pem_priv.encode('utf-8')
|
||||||
|
|
||||||
|
if type(pem_cert) == unicode:
|
||||||
|
pem_cert = pem_cert.encode('utf-8')
|
||||||
|
|
||||||
pk.assign_rsa(RSA.load_key_string(pem_priv))
|
pk.assign_rsa(RSA.load_key_string(pem_priv))
|
||||||
cert = X509.load_cert_string(pem_cert)
|
cert = X509.load_cert_string(pem_cert)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue