Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/xmlsec/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,13 @@ def __init__(self, filename, private):
if not isinstance(self.key, rsa.RSAPrivateKey):
raise XMLSigException("We don't support non-RSA private keys at the moment.")

# XXX now we could implement encrypted-PEM-support
self.cert_pem = self.key.private_bytes(
encoding=serialization.Encoding.PEM,
format=serialization.PrivateFormat.PKCS8,
encryption_algorithm=serialization.NoEncryption())
# XXX Do not leak private key -- is there any situation
# where we might need this pem?
self.cert_pem = None
# self.cert_pem = self.key.private_bytes(
# encoding=serialization.Encoding.PEM,
# format=serialization.PrivateFormat.PKCS8,
# encryption_algorithm=serialization.NoEncryption())

self.keysize = self.key.key_size
else:
Expand Down