EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Signature.handler is null

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#13834
Posted: 07/07/2010 06:04:52
by scama scamutza (Basic support level)
Joined: 07/07/2010
Posts: 5

hi,

I have a problem when I try to get the certificate of the signature.

this is my code

FileStream fichero = new FileStream(TempPath,FileMode.Open,FileAccess.ReadWrite);

TElPDFDocument doc = new TElPDFDocument();
doc.Open(fichero);

TElPDFSignature sig = new TElPDFSignature(doc);
sig = doc.get_Signatures(0);

TElPDFPublicKeySecurityHandler Handler = (TElPDFPublicKeySecurityHandler)sig.Handler;

Here I got the error because the sig.Handler is null.

Any idea?

Thanks.
#13835
Posted: 07/07/2010 06:14:05
by Ken Ivanov (EldoS Corp.)

Thank you for contacting us.

1) Does the TinyProcessor sample expose the same problem?

2) If it does, could you please post the problematic document here or to the Helpdesk?
#13837
Posted: 07/07/2010 06:18:40
by Eugene Mayevski (EldoS Corp.)

Did you try the sample project in <Samples>\C#\PDFBlackbox\PDFProcessor folder? Does it have the problem?


Sincerely yours
Eugene Mayevski
#13839
Posted: 07/07/2010 06:30:52
by scama scamutza (Basic support level)
Joined: 07/07/2010
Posts: 5

I tried te sample project and it works fine.
thanks.
#13840
Posted: 07/07/2010 06:39:58
by Ken Ivanov (EldoS Corp.)

Please check that the following two lines are present in your code:

// the following two functions *must* be called before PDF functionality is used
SBPDF.Unit.Initialize();
SBPDFSecurity.Unit.Initialize();
#13841
Posted: 07/07/2010 06:40:26
by Eugene Mayevski (EldoS Corp.)

Then you need to find the differences between your code and the sample. For example, have you set the (trial) license key?


Sincerely yours
Eugene Mayevski
#13844
Posted: 07/07/2010 06:52:22
by scama scamutza (Basic support level)
Joined: 07/07/2010
Posts: 5

Yes, the trial license is set.

this is the result in my proyect

?Document.get_Signatures(0)
{SBPDF.TElPDFSignature}
base {SBUtils.TSBDisposableBase}: {SBPDF.TElPDFSignature}
AllowedChanges: 0
AuthorName: "Carlos Serrano Cinca"
ContactInfo: "serrano@unizar.es"
Handler: null
Invisible: false
Location: "Universidad de Zaragoza"
MDPHashAlgorithm: 1
Page: 0
Reason: "Factura electrónica DEMO"
SignatureName: "Signature2"
SignatureType: 1
SigningTime: {13/02/2010 12:53:08}
UseHexEncoding: false
WidgetProps: {SBPDF.TElPDFSignatureWidgetProps}

this is the result in TinyProcessor

?doc.get_Signatures(0)
{SBPDF.TElPDFSignature}
base {SBUtils.TSBDisposableBase}: {SBPDF.TElPDFSignature}
AllowedChanges: 0
AuthorName: "Carlos Serrano Cinca"
ContactInfo: "serrano@unizar.es"
Handler: {SBPDFSecurity.TElPDFPublicKeySecurityHandler}
Invisible: false
Location: "Universidad de Zaragoza"
MDPHashAlgorithm: 1
Page: 0
Reason: "Factura electrónica DEMO"
SignatureName: "Signature2"
SignatureType: 1
SigningTime: {13/02/2010 12:53:08}
UseHexEncoding: false
WidgetProps: {SBPDF.TElPDFSignatureWidgetProps}


there are´t any diferencia expect Handler. Whithout handler y can´t get the certificate.
#13845
Posted: 07/07/2010 06:54:28
by scama scamutza (Basic support level)
Joined: 07/07/2010
Posts: 5

I tried TinyProcessor code in my proyect. it don´s works.
#13846
Posted: 07/07/2010 07:28:42
by Ken Ivanov (EldoS Corp.)

Please compare the code of the projects (both demo and yours) attentively. There should be some differences that result in the problem you are facing.

In particular, the handler is not being assigned if aforementioned Initialize() calls are missing.
#13847
Posted: 07/07/2010 08:48:57
by scama scamutza (Basic support level)
Joined: 07/07/2010
Posts: 5

Ok...this part was the problem.

SBPDF.Unit.Initialize();
SBPDFSecurity.Unit.Initialize();

Thanks.
Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.

Reply

Statistics

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