EldoS | Feel safer!

Software components for data protection, secure storage and transfer

I am pretty ungry

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#450
Posted: 06/16/2006 04:56:24
by Rafael Hernández (Basic support level)
Joined: 06/16/2006
Posts: 26

I have been writting for a long time a post5 and when I try to post it your forum applications said that I have no rights to do such. Why????????
#451
Posted: 06/16/2006 04:56:53
by Rafael Hernández (Basic support level)
Joined: 06/16/2006
Posts: 26

And know it works. m Arggggggggt
#452
Posted: 06/16/2006 04:57:34
by Rafael Hernández (Basic support level)
Joined: 06/16/2006
Posts: 26

Well i will try again. Wait.....
#453
Posted: 06/16/2006 05:07:06
by Rafael Hernández (Basic support level)
Joined: 06/16/2006
Posts: 26

I have a problem trying to use you secureblackbox product for signing a PDF file that is created and should be signed in the server part of an aplicattion while the certificate resides in a client machine.

I can export the exportable side of the certificate to a string array, take it to the server and load the certificate in the server memory store with no problems.I use CAPICOM.

The issue comes when i want your code to take care of the server memorystore where the certificate now resides.

I have found no way to do so. Neither of loading such certificate directly from a stream into a certificate "TElX509Certificate" object to add it then to your "TElMemoryCertStorage" and use it for signing.

Please help for I have been a long while with this piece of code.

Thank you for your forum anyway
#454
Posted: 06/16/2006 05:22:19
by Ken Ivanov (EldoS Corp.)

Would you be so kind to clarify:
a) which components/methods are you using,
b) what exactly errors are you encountering?

It would be excellent if you provide us a chunk of your code that does not work for you.
#455
Posted: 06/16/2006 05:40:18
by Rafael Hernández (Basic support level)
Joined: 06/16/2006
Posts: 26

First I make the certificate exportable on the client side by setting such conditions on instalation.

Second I use a web page with a lot of VBscript and CAPICOM code to let the client select and export the exportable side of the certificate he wants to use into a text field and then I use .NET code to throw such array into a table field as i say.

Then I ask the .NET application to import the exported piece of the certificate to the memory store of the server through the:

Dim MemoryStore As New Store
MemoryStore.Open(CAPICOM_STORE_LOCATION.CAPICOM_MEMORY_STORE, "MemStore", CAPICOM_STORE_OPEN_MODE.CAPICOM_STORE_OPEN_READ_WRITE)
MemoryStore.Import(Dtb2.Rows.Item(0).Item("firma"))
MemoryStore.Close()

I now would like to make the .net code to take control of the memorystore trhough your

Dim CertStorage As TElMemoryCertStorage
CertStorage = New TElMemoryCertStorage

code but when i then try to count the number of certificates in the CertStorage I get nothing. It looks like the 'New' statement clears the store or that I am pointing to any other store.

#456
Posted: 06/16/2006 05:59:39
by Ken Ivanov (EldoS Corp.)

This behavior is absolutely natural -- SecureBlackbox memory storages have nothing common with CAPICOM memory storages. That is, MemoryStore and CertStorage objects from the code above are completely different objects with their own certificate sets.

Please consider importing the certificate directly to the CertStorage object (load it to the TElX509Certificate instance and then add it to the CertStorage using TElMemoryCertStorage.Add() method).
#466
Posted: 06/16/2006 14:47:12
by Rafael Hernández (Basic support level)
Joined: 06/16/2006
Posts: 26

The issue is that I have tryed several way of importing the certificate to the TElX509Certificate instance and than adding it to the CertStorage using TElMemoryCertStorage.Add() method.

I have tryed to load it directly but the exported certificate chunk is not a stream and so I have gone through translating it into a stream by

TempFile = Path.GetTempFileName
Dim output As System.IO.TextWriter
output = System.IO.File.AppendText(TempFile)
output.WriteLine(Dtb2.Rows.Item(0).Item("firma")) 'the string array with th eexported certificated is placed in this field
output.Close()
Dim Firma As FileStream
Firma = New FileStream(TempFile, FileMode.Open, FileAccess.ReadWrite, FileShare.Read)

and then I have tried loading the stream into the TElX509Certificate through

Dim Cert As TElX509Certificate
Cert.LoadFromStream(certif, 0)

But I get the "Invalid certificate data" message and the certificate does not load into the store.
#467
Posted: 06/16/2006 14:57:48
by Rafael Hernández (Basic support level)
Joined: 06/16/2006
Posts: 26

If I use

Cert.LoadFromStreamSPC(Firma, 0)

to load the stream into the TElX509Certificate I can load it but when I try to add the certificate using

CertStorage.Clear()
CertStorage.Add(Cert, False)

to the store I get the "Invalid certificate data" message.
#468
Posted: 06/16/2006 15:11:16
by Ken Ivanov (EldoS Corp.)

Most likely, you are trying to load the certificate using the wrong method. Please consider using TElX509Certificate.DetectCertFileFormat() method to detect the actual format of certificate:

Dim Fmt as integer
Fmt = cert.DetectCertFileFormat(Nothing, "cert.pfx")
Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.

Reply

Statistics

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