1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| private static XMLSignature test_create_signature_enveloping2
(DigestMethod dm, SignatureMethod sm, KeyInfo ki, Key signingKey,
KeySelector ks, boolean b64,String mandate) throws Exception {
// create reference
Reference ref;
if (b64) {
ref = fac.newReference("#object", dm, Collections.singletonList
(fac.newTransform(Transform.BASE64,
(TransformParameterSpec) null)), null, null);
} else {
ref = fac.newReference("#object", dm);
}
// create SignedInfo
SignedInfo si = fac.newSignedInfo(withoutComments, sm,
Collections.singletonList(ref));
Document doc = db.parse(new ByteArrayInputStream(mandate.getBytes()));
XMLObject obj = fac.newXMLObject(Collections.singletonList
(new DOMStructure(racine)), // createTextNode(text))),
"object", null, null);
SignatureProperties properties = fac.newSignatureProperties();
//...forcément ça ne marche pas je n'ai pas mis d'argument...Je ne savais pas trop quoi mettre
// create XMLSignature
XMLSignature sig = fac.newXMLSignature
(si, ki, Collections.singletonList(obj), null, null);
DOMSignContext dsc = new DOMSignContext(signingKey, doc);
//... |
Partager