Created
November 6, 2009 07:19
-
-
Save hdknr/227793 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load X.509 data from XML-Security signed XML file with KeyInfo | |
# | |
# import xmlsec,libxml2 | |
from M2Crypto import X509 | |
s= xmlsec.findNode( | |
libxml2.parseDoc(self.signed_xml.encode('UTF-8')).getRootElement(), | |
xmlsec.NodeX509Certificate,xmlsec.DSigNs).content | |
s = '-----BEGIN CERTIFICATE-----\n%s\n-----END CERTIFICATE-----\n' % s | |
cert = X509.load_cert_string(s) | |
print type(cert),cert.__class__ | |
# <type 'instance'> M2Crypto.X509.X509 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment