SecureBlackbox Knowledge Base

Recent XML Articles


SigningTime element shows the time in UTC, but the recipientwants it to be in local timezone. How do I change the behavior?

For example, SigningTime contains "2016-08-30T14:02:40.000Z", and you need a format like "2016-08-30T14:02:400-05:00". To do this you need to set the signing tim…

How do I modify 'QualifyingProperties' element (main element in XAdES) properties like an Id and/or node prefix?

First, set XAdES interface properties like: PolicyId, ProductionPlace, SignerRole, Included, SigningCertificates, XAdESForm and XAdESVersion. Then call Generate …

How to fill SigPolicyHash for XAdES

The digest value of the signature policy is calculated over SigPolicyId \Identifier element. If Identifier element contains an URI, then the hash is calculated o…

How do I change order of RDN elements or control their appearance in X509IssuerName and/or X509SubjectName element?

There is a global variable RDNDescriptorMap in SBXMLSec unit/namespace that controls the order. For example the original order is: C=EU, O=EldoS, OU=EldoS 1 EU B…

How to reference elements inside the Signature element

Create an instance of TElXMLReference class, but don’t fill URIData and URINode properties. Add it to the References after the call to UpdateReferencesDigest(). …

Is there any way to put the prefix "e;ds"e; to XML-DSig nodes?

To do this, add the following code (C# notation): ElXMLSigner.Sign(); // this method generate “Signature” structure that could be accessed using ElXMLSigner.Sign…

How to modify 'EncryptedData' element properties such as Id and/or node prefix?

First, you need to fill all properties needed for encryption, then call Encrypt() method. This method will perform encryption and build “EncryptedData” structure…

How do I modify 'Signature' element properties, e.g. <Id>?

How do I modify 'Signature' element properties, e.g. <Id>

What versions of XAdES are supported?

XAdES versions 1.1.1, 1.2.2, 1.3.2 and 1.4.1 (1.4.2) are supported. For XAdES (XAdES-BES, XAdES-EPES) and XAdES-T forms, there is a simple interface available vi…

What versions of XAdES are supported?

XAdES versions 1.1.1, 1.2.2, 1.3.2 and 1.4.1 (1.4.2) are supported. For XAdES (XAdES-BES, XAdES-EPES) and XAdES-T forms, there is a simple interface available vi…

When uisng ValidateReferences method in TElXMLVerifier, I get "e;Reference requires a context"e; error. Quite confusing, isn

The error is returned when there exists an XMLReference element with neither URIData nor URINode, nor URIStream set. After loading the signature into TElXMLVerif…

When loading large XML document, OutOfMemory error happens. How do I deal with it?

DOM XML parser supports two modes: normal and delay load. In normal mode, the XML document is parsed and an XML DOM tree (node-tree) is created, after loading th…

Can I customize <KeyInfo> tag content?

Please use IncludeKeyValue and IncludeDataParams properties of TElXMLKeyInfoX509Data class.…

I have modified the signed data, but VerifySignature method reports the signature as valid. Why is that?

The ValidateSignature() method checks the integrity of the signature (SignedInfo element), it doesn't check the signer key/certificate and the references. To val…

How do I include certificates when creating XML signature?

First of all, to include a signing key or certificate to the signature you need to set TElXMLSigner.IncludeKey property to true (this is default value). If you n…

I have a license for PDFBlackbox, XMLBlackbox or PKIBlackbox. How do I use timestamping?

How to use timestamping when possesing a license for PDFBlackbox, XMLBlackbox or PKIBlackbox.

How do I remove ds: prefix when signing the data?

To do this add the following code: after ElXMLSigner.Sign()/GenerateSignature()/GenerateSignatureAsync(); (this method generates “Signature” structure that could…

I have a license for PDFBlackbox, XMLBlackbox or PKIBlackbox. How do I use timestamping?

You can perform timestamping using one of the components: TElHTTPTSPClient and TElFileTSPClient. The first component makes use of TElHTTPSClient, which is covere…

How to extract a key from 'KeyInfo' element?

To extract a key from “KeyInfo” element you need to use the following code (C# notation): for (int i = 0; i ElXMLVerifier.Signature.KeyInfo.Count; i++) if (ElXML…

Signing documents according to Spanish Factura format (government invoices)

Here you will find the sample code, which signs "factura" electronic XML documents (Spanish government's invoices), as described in this document. The resulting …