Bu sayfa salt okunur. Kaynağı görebilirsiniz ama değiştiremezsiniz. Bunun yanlış olduğunu düşünüyorsanız yöneticiye danışın.
E-Invoice is an XML document having a special format. The signing of E-Invoices is very similar to enveloped signatures explained in İmza Yapıları. The signature must be placed in the particular field defined in E-Invoice standard.
<sxh java> get the element that signature will be added Element exts = (Element)faturaDoc.getDocumentElement().getElementsByTagName("ext:UBLExtensions").item(0); Element ext = (Element)exts.getElementsByTagName("ext:UBLExtension").item(0); Element extContent = (Element)exts.getElementsByTagName("ext:ExtensionContent").item(0); generate signature Context context = createContext(); context.setDocument(faturaDoc); XMLSignature signature = new XMLSignature(context, false); attach signature to envelope structure extContent.appendChild(signature.getElement()); </sxh> Then, the method transform ,in which the whole document is included and only the signature is omitted, is added. <sxh java> use enveloped signature transform Transforms transforms = new Transforms(context); transforms.addTransform(new Transform(context, TransformType.ENVELOPED.getUrl()));
transform
add whole document(=_fckg_QUOTfckg_QUOT_) with envelope transform, with SHA256 and don't include it into signature(false) signature.addDocument("", "text/xml", transforms, DigestMethod.SHA_256, false); </sxh> Finally, the signer role ,verification public key and signing time attributes are added as stated in E-Invoice standard. <sxh java> add signer role information SignerRole rol = new SignerRole(context, new ClaimedRole[]{new ClaimedRole(context, "Supplier")}); signature.getQualifyingProperties().getSignedSignatureProperties().setSignerRole(rol); e-fatura standard wants public key info in the signature PublicKey pk = KeyUtil.decodePublicKey(new ECertificate(cert.getEncoded()).getSubjectPublicKeyInfo()); signature.getKeyInfo().add(new KeyValue(context, pk)); add signing time signature.getQualifyingProperties().getSignedSignatureProperties().setSigningTime(getTime()); </sxh> The code is in tr.gov.tubitak.uekae.esya.api.xades.example.efatura.EFatura.
tr.gov.tubitak.uekae.esya.api.xades.example.efatura.EFatura