EldoS | Feel safer!

Software components for data protection, secure storage and transfer

generate p7s with the signed data included

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#25383
Posted: 06/21/2013 07:32:02
by Rodrigo Monteiro (Basic support level)
Joined: 06/21/2013
Posts: 5

hi i have been trying the demo component to sign a file ( PDF ) and generate the p7s

I was using the MessagesDemo and it generate the p7s, but the file lost its extension

My signed data was a pdf named OriginalFile.pdf after using the demo the name of the file inside the p7s became just OriginalFile with no extension at all, so if i use any p7s viewer i cant open the file (signed file)

Are there some way to include the extension?

I'm using the activex version
#25384
Posted: 06/21/2013 07:42:27
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

You should simply append the needed extension to a file path used to save the result. Also in ActiveX edition there are TElMessageSigner.SignFile/SignFileDetached methods that accepts paths to input and output files.
#25385
Posted: 06/21/2013 08:54:42
by Rodrigo Monteiro (Basic support level)
Joined: 06/21/2013
Posts: 5

Hi Vsevolod Ievgiienko that was a fast reply tks :)

Sure, but the signed file can be a PDF, a doc or anything else

In my example i know it was a pdf file, but the is no way i can do that for every file that will be signed because the process will be automatic and after the sign process i cant indentify the original extension


Can you provide some delphi example for TElMessageSigner.SignFile with pfx saving as p7s with the signed data included in the p7s?

Regards Rodrigo Monteiro
#25389
Posted: 06/22/2013 07:49:36
by Ken Ivanov (EldoS Corp.)

Hello Rodrigo,

TElMessageSigner does not generate output file names - it takes the names or the underlying file streams from the component user and saves the signature where asked. So it is your code that should generate a proper name for output files.

For instance, you can append the .p7s extension to the original name to preserve it in the output file.
#25413
Posted: 06/24/2013 07:03:29
by Rodrigo Monteiro (Basic support level)
Joined: 06/21/2013
Posts: 5

Hi Ken Ivanov, my problem is not in generate a proper name for the output files. my problema is KNOW what should be the output name or to be more clear i want to preserve the extension from de imput file name.

The process is something like

1-Sign a file (.doc, .xls, .pdf, .jpg and so on)
2-Generate a ps7 signed file with the original file included and save it for future use
3-Read a ps7 check signature and EXTRACT the original signed file

The step 3 can be used at any time in the furure, and here is my problem, because after signed i dont know wich extension the original imput file was using.

When i sign a .DOC file when i extract this file from the .ps7 i need save it as .DOC otherwise it will not open.

The same rule aply if it a .XLS, .PDF and so on.

The main problem is that after the file is signed the extension is gone and when i extract the file from the ps7 there is no safe way to know wich one it was before.


Ragards Rodrigo Monteiro
#25414
Posted: 06/24/2013 07:07:05
by Eugene Mayevski (EldoS Corp.)

As Ken mentioned, you can give any file name to signed file. I.e. when you sign the document.doc, you create a signed file named document.doc.p7s . Now on step 3 you remove p7s extension and get back your document.doc.


Sincerely yours
Eugene Mayevski
#25415
Posted: 06/24/2013 07:11:02
by Vsevolod Ievgiienko (EldoS Corp.)

Also you can add a custom field to TElMessageSigner.UnauthenticatedAttributes that will contain input file extension.
#25441
Posted: 06/25/2013 06:55:22
by Rodrigo Monteiro (Basic support level)
Joined: 06/21/2013
Posts: 5

Quote
Eugene Mayevski wrote:
As Ken mentioned, you can give any file name to signed file. I.e. when you sign the document.doc, you create a signed file named document.doc.p7s . Now on step 3 you remove p7s extension and get back your document.doc.



Tks again for your reply Eugene.

Sure i can do that, but if the user change the file name i will not be able to extract the file.

there is on the market a lot of p7s viewers that relly on the file extension to show to the user the signed file and without one they are unable to do that on p7s files generated by the component

but tks anyway for your reply you gus are very good in support

regards

Rodrigo Monteiro
#25442
Posted: 06/25/2013 07:02:27
by Rodrigo Monteiro (Basic support level)
Joined: 06/21/2013
Posts: 5

Quote
Vsevolod Ievgiienko wrote:
Also you can add a custom field to TElMessageSigner.UnauthenticatedAttributes that will contain input file extension.



That is a good workaround, but it will work only if i use a proprietary p7s viewer, and unfortunately the clients can use anyone available on the web, and most of the relly on then signed extension to show the signed file to the user

tks anyway for the fast reply

regards

Rodrigo Monteiro
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages

Reply

Statistics

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