Commit 375a67cc authored by Martin van Es's avatar Martin van Es
Browse files

Use xmlsec for all signing

parent 0f33dbb2
#!/usr/bin/env python
from utils import read_config, Resource, server
from utils import read_config, Resource, Server
from flask import Flask, Response
config = read_config()
app = Flask(__name__)
server = Server()
@app.route('/<domain>/entities/<path:entity_id>', methods=['GET'])
def serve(domain, entity_id):
......
......@@ -6,8 +6,8 @@ from concurrent.futures import ThreadPoolExecutor
from lxml import etree as ET
# import traceback
from utils import hasher, Signers
from utils import hasher
from signers import Signers
# Find all IdP's in edugain metadata
idps = []
......
import xmlsec
from signxml import XMLSigner
cert = open("meta.crt").read()
key = open("meta.key").read()
cert = "meta.crt"
key = "meta.key"
def Signers(signer):
def _normal_signer(xml):
print("Normal signer")
return XMLSigner().sign(xml, key=key, cert=cert)
return xmlsec.sign(xml, key_spec=key, cert_spec=cert)
def _test_signer(xml):
print("Test signer")
return XMLSigner().sign(xml, key=key, cert=cert)
return xmlsec.sign(xml, key_spec=key, cert_spec=cert)
def _foobar_signer(xml):
print("Foobar signer")
return XMLSigner().sign(xml, key=key, cert=cert)
return xmlsec.sign(xml, key_spec=key, cert_spec=cert)
def _hsm_signer(xml):
print("HSM signer")
......
......@@ -151,6 +151,3 @@ class Server:
def __getitem__(self, domain):
return self.__dict__[domain]
server = Server()
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