2017-10-18 1 views
0

Wie ändert man die Signatur-ID "xmldsig-e8129bc4-957f-4e9c-b8dc-d0a3482bb97b" von "SigFrs"?Wie ändere ich die Signatur ID?

<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="xmldsig-e8129bc4-957f-4e9c-b8dc-d0a3482bb97b"> 

Dies ist mein Code:

 XadesSigningProfile p = new XadesBesSigningProfile(kp); 
     XadesSigner signer = p.newSigner();   
     javax.xml.parsers.DocumentBuilderFactory factory = javax.xml.parsers.DocumentBuilderFactory.newInstance(); 
     factory.setNamespaceAware(true); 
     javax.xml.parsers.DocumentBuilder builder = null; 
     builder = factory.newDocumentBuilder(); 


     // XML FILE TO BE SIGNED 
     Document doc1 = builder.parse(new File("FileNotSigned.xml")); 


     // OBJ 
     IndividualDataObjsTimeStampProperty dataObjsTimeStamp = new IndividualDataObjsTimeStampProperty(); 
     AllDataObjsCommitmentTypeProperty globalCommitment = AllDataObjsCommitmentTypeProperty.proofOfApproval(); 
     CommitmentTypeProperty commitment      = CommitmentTypeProperty.proofOfCreation(); 

     // OBJECT 
     DataObjectDesc obj1 = new DataObjectReference(""); 
     obj1.withTransform(XPath2Filter.intersect("InvoiceHeader")); 
     SignedDataObjects dataObjs = new SignedDataObjects(obj1); 

     // SIGN 
     signer.sign(dataObjs, nodeToAttachSignature); 


     // TRANSFORMER 
     Transformer transformer = TransformerFactory.newInstance().newTransformer(); 

     // XML SIGNED  
     Result output = new StreamResult(new File("FileSigned.xml")); 
     Source input = new DOMSource(doc1); 
     transformer.transform(input, output); 

Antwort