EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Decrypt a message - certificate.cer

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);
CertFirma := TElX509Certificate.Create(nil);
VerifyingCertificates.Add(CertFirma, False);

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

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

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.



Topic viewed 482 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!