EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Decrypt a message - certificate.cer

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#26140
Posted: 08/15/2013 18:40:25
by ARTURO ORTIZ (Standard support level)
Joined: 08/15/2013
Posts: 1

hi all,

i have a problem when i try decrypt a message

when i try decrypt a message, the program show the error
"Invalid certificate data".

The certificate's extension is cer, i need know if i can use this certificate with this extension.

i used the next code to open the certificate

Stream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite);
try
CertFirma := TElX509Certificate.Create(nil);
CertFirma.LoadFromStream(Stream);
VerifyingCertificates.Add(CertFirma, False);

when i want decrypt a message use the nex code:
Msg.Load(FileName,ChangeFileExt(FileName, '.bin'))


Thanks
#26141
Posted: 08/16/2013 01:45:50
by Mykola Olshevsky (Basic support level)
Joined: 07/07/2005
Posts: 450

Hi. In .cer file stored only public part of the certificate, but for decryption you need the private key corresponding to the certificate. They are usually stored in .pfx files (with certificates), or in .pem/.key.

Reply

Statistics

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