Commit 0f33dbb2 authored by Martin van Es's avatar Martin van Es
Browse files

Add HSM test script

parent 742425f3
#!/usr/bin/env python
from lxml import etree as ET
import xmlsec
tree = ET.ElementTree(file='metadata/test/md0.xml')
root = tree.getroot()
ns = root.nsmap.copy()
ns['xml'] = ''
entity_descriptor = root.findall('md:EntityDescriptor', ns)[0]
signed = xmlsec.sign(entity_descriptor, key_spec="pkcs11:///usr/lib/softhsm/")
# print(ET.tostring(signed, pretty_print=True).decode())
if xmlsec.verify(signed, 'hsm.crt'):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment