CounterSignature에 dades : Object라는 "xmldsig-my-object"를 삽입하여 xades4j 라이브러리와 함께 다음 xml 구조를 형성해야합니다.xades의 CounterSignature 요소에 SignedDataObject (ds : Object)를 삽입하는 방법 : UngignedProperties
<ds:Signature>
...
<ds:Object>
...
<xades:UnsignedProperties>
<xades:UnsignedSignatureProperties>
<xades:CounterSignature>
<ds:Signature>
<ds:SignedInfo>
<ds:Reference Id... Type="xmldsig#Object" URI="xmldsig-my-object">
// !!! here I need to add reference to my-object
</ds:Reference>
</ds:SignedInfo>
<ds:Object Id="xmldsig-my-object">
// !!! here I need to add my-object
</ds:Object>
</ds:Signature>
</xades:CounterSignature>
</xades:UnsignedSignatureProperties>
</xades:UnsignedProperties>
</ds:Object>
</ds:Signature>
나는 (요소 signatureNode)이 된 XAdES 서명을 생성하고 반대 서명을 풍요롭게 :
Element signatureNode = ...;
XadesSignatureFormatExtender extender = new XadesFormatExtenderProfile()
.getFormatExtender();
XMLSignature sig = new XMLSignature(signatureNodeToEnrich, "");
try {
final XadesSigner counterSigner =
new XadesTSigningProfile(myKeyingDataProvider)
.withPolicyProvider(mySignaturePolicyInfoProvider)
.withAlgorithmsProviderEx(myXadesAlgorithmsProviderEx)
.withTimeStampTokenProvider(myTimeStampTokenProvider())
.newSigner();
Collection<UnsignedSignatureProperty> usp = new ArrayList<>(1);
usp.add(new CounterSignatureProperty(counterSigner));
extender.enrichSignature(sig, new UnsignedProperties(usp));
} catch (Exception exc) {
exc.printStackTrace(System.out);
throw exc;
}
내가 CouterSignature의 SignedInfo에에 Object가 일반적인 방법처럼 을 참고 추가 어떻게해야하나요 :
SignedDataObjects signedObjs = new SignedDataObjects();
Document docObj1 = createDocument();
.....................
DataObjectDesc myObj1 = new EnvelopedXmlObject(..., "text/xml", null);
signedObjs.withSignedDataObject(myObj1);
signer = new XadesTSigningProfile(...).newSigner();
signer.sign(signedObjs, docDest);
이에 대한 지원이 추가되었습니다. https://code.google.com/p/xades4j/source/detail?r=251 – lgoncalves
Luis에게 감사드립니다. 나는이 변화에 정말로 감사한다. – dva