EldoS | Feel safer!

Software components for data protection, secure storage and transfer

help - from delphi to php

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#37606
Posted: 08/31/2016 18:18:39
by stelio pizzolatto (Premium support level)
Joined: 12/04/2015
Posts: 28

Hi every one

Have these two Delphi code lines copied from a example

Ref := TElXMLReference.Create();
Ref.TransformChain.Add(TElXMLEnvelopedSignatureTransform.Create);

The first line in PHP would be:

$Ref = new TElXMLReference(null);

The question is: how would the second line be in PHP?

Sorry fr the silly question
#37615
Posted: 09/01/2016 06:30:16
by Dmytro Bogatskyy (EldoS Corp.)

Thank you for contacting us.

SecureBlackbox comes with XML_Sign demo php project that illustrates the use of TElXMLSigner component. This sample is a great place to start, as it might be of great help for you in your research and development processes. The sample can be found in <SecureBlackbox>\Samples\XMLBlackbox\Sign directory after you install SecureBlackbox on your computer.
The code from this demo:
Code
// adding a reference for the whole document
$k = $xmlSigner->References->Add();
$ref = $xmlSigner->References->get_Reference($k);
$ref->DigestMethod = TElXMLDigestMethod::xdmSHA1;
$ref->URI = "";
$ref->URINode = $xmlDocument->DocumentElement;
$ref->TransformChain->AddEnvelopedSignatureTransform();


Of course, you can translate above code (adding reference and enveloped signature transform) to use class constructors directly:
Code
$ref = new TElXMLReference();
$transform = new TElXMLEnvelopedSignatureTransform();
$ref->TransformChain->Add($transform);
$xmlSigner->References->Add($ref);

$transform->detachHandle();
$ref->detachHandle();
// detachHandle() method "detach" wrapped object, so it won't be cleared when the php variable is freed. It needed only for those objects that added to the list/object that is responsible for their release (like References or TransformChain).
#37617
Posted: 09/01/2016 10:58:14
by stelio pizzolatto (Premium support level)
Joined: 12/04/2015
Posts: 28

Many thanks.. helped a lot

Reply

Statistics

Topic viewed 427 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!