EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TElXMLSigner

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#11107
Posted: 09/21/2009 07:09:13
by Kvetoslav Jansta (Standard support level)
Joined: 05/06/2008
Posts: 56

Hello,
one question about using this component : TElXMLSigner

please, how not to export some elements ?
(KeyValue - RSAKeyValue - Modulus - Exponent) - (X509IssuerSerial) - (X509SubjectName)

but I need others, like X509Data.X509Certificate

thank you,
slava jansta
#11112
Posted: 09/21/2009 11:55:55
by Dmytro Bogatskyy (EldoS Corp.)

Quote
please, how not to export some elements ?
(KeyValue - RSAKeyValue - Modulus - Exponent) - (X509IssuerSerial) - (X509SubjectName)

Please use the IncludeDataParams and IncludeKeyValue properties.
For example:
Code
X509Data.IncludeDataParams := [xkidX509Certificate];
X509Data.IncludeKeyValue := False;
#11115
Posted: 09/22/2009 01:47:20
by Kvetoslav Jansta (Standard support level)
Joined: 05/06/2008
Posts: 56

Quote
Bogatskyy wrote:
Please use the [URL=http://www.eldos.com/documentation/sbb/documentation/ref_cl_xmlkeyinfox509data_prp_includedataparams.html]IncludeDataParams[/URL] and [URL=http://www.eldos.com/documentation/sbb/documentation/ref_cl_xmlkeyinfox509data_prp_includekeyvalue.html]IncludeKeyValue[/URL] properties.


yes, is ok, thank you.

other point, I can not find, how to export transform element

<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#envelopedsignature"
/>
</Transforms>
#11116
Posted: 09/22/2009 03:29:17
by Dmytro Bogatskyy (EldoS Corp.)

You need to add an instance of the Enveloped Signature Transform into a transformation chain.
For example:
Code
ElXMLReference.TransformChain.Add(TElXMLEnvelopedSignatureTransform.Create);
#11145
Posted: 09/28/2009 04:32:48
by Thanh Nguyen Trung (Priority Standard support level)
Joined: 09/12/2008
Posts: 73

Could you please show me the way to add a Timestamp to an existing signature. (Create XADES-T from XADES). There is a function AddSignatureTimestamp but do not know how to use it.

BRs,
Thanh
#11146
Posted: 09/28/2009 04:38:44
by Dmytro Bogatskyy (EldoS Corp.)

Quote
Could you please show me the way to add a Timestamp to an existing signature. (Create XADES-T from XADES). There is a function AddSignatureTimestamp but do not know how to use it.

Load the signature with ElXMLVerifier and ElXAdESVerifier, you can verify it and then add a Signature Timestamp using AddSignatureTimestamp method.
#11147
Posted: 09/28/2009 04:54:37
by Thanh Nguyen Trung (Priority Standard support level)
Joined: 09/12/2008
Posts: 73

I load signature with XMLVerifier:

TElXMLDOMDocument xmlDocument = new TElXMLDOMDocument();
MemoryStream stream = new MemoryStream();

stream.Write(xadesSignature, 0, xadesSignature.Length);
stream.Position = 0;
xmlDocument.LoadFromStream(stream);
stream.Close();
signatureXML.LoadFromXML(xmlDocument.DocumentElement);

TElXMLVerifier verifier = new TElXMLVerifier();
verifier.Load(xmlDocument.DocumentElement);

but
verifier.XAdESProcessor (ElXAdESVerifier) is always null.

What am i wrong?

The signature is a detached XADES one.

Best
Thanh
#11149
Posted: 09/28/2009 05:40:21
by Dmytro Bogatskyy (EldoS Corp.)

Quote
verifier.XAdESProcessor (ElXAdESVerifier) is always null.

You should create the instance of TElXAdESVerifier by yourself. Please see XMLBlackbox\Signer sample. If you don't set XAdESProcessor property this means that you don't care if XAdES is present or not.
Your code should look like this:
Code
TElXMLVerifier verifier = new TElXMLVerifier();
XAdESVerifier = new TElXAdESVerifier();
Verifier.XAdESProcessor = XAdESVerifier;
verifier.Load(xmlDocument.DocumentElement);
if (XAdESVerifier.QualifyingProperties != null)
{
  XAdESVerifier.AddSignatureTimestamp(...);
}
#11167
Posted: 09/28/2009 21:08:08
by Thanh Nguyen Trung (Priority Standard support level)
Joined: 09/12/2008
Posts: 73

Thanks, I solved the issue now
#11200
Posted: 09/30/2009 21:56:13
by Thanh Nguyen Trung (Priority Standard support level)
Joined: 09/12/2008
Posts: 73

Hi,

I want to get content of signature in a byte array, below is the code:

Quote

xmlDocument = new TElXMLDOMDocument();
verifier.Signature.SaveToXML(xmlDocument, null);
stream = new MemoryStream();
xmlDocument.SaveToStream(stream, SBXMLDefs.Unit.xcmNone, "utf-8");
int length = (int)stream.Length;
stream.Position = 0;
m_signedData = new byte[length];
stream.Read(m_signedData, 0, length);
stream.Close();
xmlDocument.Dispose();

Why the m_signedData contains just a string
"<?xml version="1.0" encoding="utf-8"?>"

What am i wrong?

Thanks & Regards,
Thanh
Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.

Reply

Statistics

Topic viewed 5237 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!