Skip to content

Commit eace864

Browse files
committed
Allow to choose algorithms when creating metadata
Signature and digest algorithms can now be selected with the following command line arguments -S <sign alg> (default: http://www.w3.org/2000/09/xmldsig#rsa-sha1) -D <digest alg> (default: http://www.w3.org/2000/09/xmldsig#sha1) Example: $ ../../tools/make_metadata.py \ -s -x /usr/bin/xmlsec1 \ -k pki/mykey.pem -c pki/mycert.pem \ -S http://www.w3.org/2001/04/xmldsig-more#rsa-sha384 \ -D http://www.w3.org/2001/04/xmlenc#sha512 \ sp_conf
1 parent 73c051e commit eace864

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tools/make_metadata.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
help="xmlsec binaries to be used for the signing")
3535
parser.add_argument('-w', dest='wellknown',
3636
help="Use wellknown namespace prefixes")
37+
parser.add_argument('-S', dest='signalg',
38+
default='http://www.w3.org/2000/09/xmldsig#rsa-sha1',
39+
help="Algorithm to sign the metadata")
40+
parser.add_argument('-D', dest='digestalg',
41+
default='http://www.w3.org/2000/09/xmldsig#sha1',
42+
help="Algorithm to compute the digest of the metadata")
3743
parser.add_argument(dest="config", nargs="+")
3844
args = parser.parse_args()
3945

@@ -76,7 +82,10 @@
7682
if args.sign:
7783
assert conf.key_file
7884
assert conf.cert_file
79-
eid, xmldoc = sign_entity_descriptor(eid, args.id, secc)
85+
sign_alg = args.signalg
86+
digest_alg = args.digestalg
87+
eid, xmldoc = sign_entity_descriptor(eid, args.id, secc, sign_alg,
88+
digest_alg)
8089
else:
8190
xmldoc = None
8291

0 commit comments

Comments
 (0)