Last version of SB support PGP? or any other component?

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
byronrocha
Posts: 4
Joined: Fri 20 Jul 2018 16:45

Last version of SB support PGP? or any other component?

Post by byronrocha » Thu 09 Aug 2018 19:40

Hi

Do you know if SecureBridge support PGP?

ViktorV
Devart Team
Posts: 2353
Joined: Wed 30 Jul 2014 07:16

Re: Last version of SB support PGP? or any other component?

Post by ViktorV » Fri 10 Aug 2018 06:41

You can use the TScCMSProcessor component for encrypting (decrypting) data: https://www.devart.com/sbridge/docs/tsccmsprocessor.htm

byronrocha
Posts: 4
Joined: Fri 20 Jul 2018 16:45

Re: Last version of SB support PGP? or any other component?

Post by byronrocha » Fri 10 Aug 2018 14:24

Great, I need to sign a file using a pgp certificate that I have created.
This is the code, but I got an error when I try to import the certificate

Cert := TScCertificate.Create(FileKeyStore.Certificates);
Cert.CertName := aPGPKeyName;
Cert.ImportFrom(aPGPPrivateKeyFileName, aPassPhrase); {Here I have an error "Wrong certificate context"}

ScCMSProcessor := TScCMSProcessor.Create(Self);
ScCMSProcessor.Storage := FileKeyStore;
ScCMSProcessor.CertificateName := aPGPKeyName;
ScCMSProcessor.Sign(aInputFileNameToSign, aOutputFileNameToSign);

ViktorV
Devart Team
Posts: 2353
Joined: Wed 30 Jul 2014 07:16

Re: Last version of SB support PGP? or any other component?

Post by ViktorV » Fri 10 Aug 2018 14:43

To encode and sign the data in the CMS protocol, you need a certificate. You can create it by yourself using different tools or buy it. For more information about obtaining a certificate, you can ask the appropriate question at the specialized forums.
After receiving the certificate, you should import it using the TScCertificate.ImportFrom method. For example,

Code: Select all

Cert.ImportFrom('MyCert.CRT').
Perhaps, you are trying to import not a certificate, but an associated private key. To import the certificate and the private key associated with the certificate, you can use the following code

Code: Select all

  Cert := TScCertificate.Create(FileKeyStore.Certificates);
  Cert.CertName := aCertName;
  Cert.ImportFrom(CerFileName); 
  Cert.Key.ImportFrom(aPGPPrivateKeyFileName, aPassPhrase);

byronrocha
Posts: 4
Joined: Fri 20 Jul 2018 16:45

Re: Last version of SB support PGP? or any other component?

Post by byronrocha » Mon 13 Aug 2018 15:41

Thanks for you answer, I tested using other certificate (crt) and it works, but, is there any way to sign a file just using a Private PGP Key and the passphrase?

Dimon
Devart Team
Posts: 2888
Joined: Mon 05 Mar 2007 16:32

Re: Last version of SB support PGP? or any other component?

Post by Dimon » Mon 20 Aug 2018 14:54

Currently SecureBridge does not provide functionality to work with PGP keys.
You can suggest this feature at our UserVoice ( http://devart.uservoice.com/forums/174370-securebridge ). If the suggestion gets a lot of votes, we will consider the possibility to implement it.

Post Reply