Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to choose algorithms when creating new metadata #645

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
15 changes: 12 additions & 3 deletions tools/make_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
help="xmlsec binaries to be used for the signing")
parser.add_argument('-w', dest='wellknown',
help="Use wellknown namespace prefixes")
parser.add_argument('-S', dest='signalg',
default='http://www.w3.org/2000/09/xmldsig#rsa-sha1',
help="Algorithm to sign the metadata")
parser.add_argument('-D', dest='digestalg',
default='http://www.w3.org/2000/09/xmldsig#sha1',
help="Algorithm to compute the digest of the metadata")
parser.add_argument(dest="config", nargs="+")
args = parser.parse_args()

Expand Down Expand Up @@ -70,16 +76,19 @@
args.sign, secc)
valid_instance(desc)
xmldoc = metadata_tostring_fix(desc, nspair, xmldoc)
print(xmldoc.decode("utf-8"))
print(xmldoc)
else:
for eid in eds:
if args.sign:
assert conf.key_file
assert conf.cert_file
eid, xmldoc = sign_entity_descriptor(eid, args.id, secc)
sign_alg = args.signalg
digest_alg = args.digestalg
eid, xmldoc = sign_entity_descriptor(eid, args.id, secc, sign_alg,
digest_alg)
else:
xmldoc = None

valid_instance(eid)
xmldoc = metadata_tostring_fix(eid, nspair, xmldoc)
print(xmldoc.decode("utf-8"))
print(xmldoc)