EldoS | Feel safer!

Software components for data protection, secure storage and transfer

No appropriate key for decryption found

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
Posted: 03/02/2007 09:54:32
by Matthew Dragiff (Standard support level)
Joined: 03/01/2007
Posts: 15

using the v. dll's -
heres the code we r using for decrypting

SBPGPKeys.TElPGPKeyring pgpKeyRing = new SBPGPKeys.TElPGPKeyring();

pgpKeyRing.Load(PublicKeyStream, PrivateKeyStream, true);
_pgpReader.DecryptingKeys = pgpKeyRing;
_pgpReader.VerifyingKeys = pgpKeyRing;
_pgpReader.Passphrase = PassPhrase;

_pgpReader.OutputStream = objDecryptedStream;

InputStream.Seek(0, SeekOrigin.Begin);

_pgpReader.DecryptAndVerify(InputStream, 0);

DecryptAndVerify throws an exception - No appropriate key for decryption found.
Debugger shows that the keyring has 1 public + 1 private key.

Any suggestions?

Posted: 03/02/2007 10:35:11
by Ken Ivanov (Team)

Please consider using TElPGPReader.KeyPassphrase property for specifying a passphrase instead of TElPGPReader.Passphrase.
Posted: 03/02/2007 12:41:23
by Matthew Dragiff (Standard support level)
Joined: 03/01/2007
Posts: 15

I tried using TElPGPReader.KeyPassphrase - same error.

I am using VS 2005/.NET Framework 3.0/SQL 2005 - is there any issues with SecureBalckBox.PKI being blocked by the CRL or something like that? I think I read a post on here that talked about it...
Posted: 03/02/2007 13:07:06
by Ken Ivanov (Team)

Please also try to handle the TElPGPReader.OnKeyPassphrase event and check if it is fired (you can also pass a key passphrase to it). There should not be any problems with .NET Framework 3.0.
Posted: 03/02/2007 14:00:37
by Eugene Mayevski (Team)

Actually ".NET 3.0" is .NET 2.0 with additional libraries.

Sincerely yours
Eugene Mayevski
Posted: 02/06/2008 16:44:35
by User 0932 (Basic support level)
Joined: 02/06/2008
Posts: 3

I am handling the TElPGPReader.OnKeyPassphrase event, but it never gets fired. I followed your instruction of using pgpReader.KeyPassPhrase = passPhrase and I'm still getting the same error. Thanks in advance.
Posted: 02/07/2008 01:38:46
by Ken Ivanov (Team)

First, please try to upgrade to the latest available version (5.2.124) and check if the issue still exists.
Posted: 02/07/2008 09:22:18
by User 0932 (Basic support level)
Joined: 02/06/2008
Posts: 3

yes, I upgraed to 5.2.124 and I still get the same message. "No appropriate OpenPGP secret key for decryption found". Here's what I'm doing

System.IO.FileStream inF, outF;

SBPGP.TElPGPReader pgpReader = new SBPGP.TElPGPReader();
SBPGPKeys.TElPGPKeyring keyring = new SBPGPKeys.TElPGPKeyring();
keyring.Load(pubKeyLocation, secKeyLocation, true);
pgpReader.OnKeyPassphrase += new SBPGPStreams.TSBPGPKeyPassphraseEvent(pgpReader_OnKeyPassphrase);

pgpReader.DecryptingKeys = keyring;
pgpReader.VerifyingKeys = keyring;
pgpReader.Passphrase = passPhrase;
pgpReader.KeyPassphrase = passPhrase;

inF = new System.IO.FileStream(encryptedFile, System.IO.FileMode.Open);
outF = new System.IO.FileStream(decryptedFile, System.IO.FileMode.Create);
pgpReader.OutputStream = outF;

pgpReader.DecryptAndVerify(inF, 0);

Posted: 02/07/2008 09:41:42
by User 0932 (Basic support level)
Joined: 02/06/2008
Posts: 3

I think I am doing something wrong with keys. I ran the sample program that came with the download(decryptandverify) and I get the same error. I am thinking I might have done something wrong when I created the keypair in the first place, although it encrypted and signed fine.
Posted: 02/07/2008 09:49:35
by Ken Ivanov (Team)

Please check that the secret key is available in the decryption keyring and the correct passphrase is specified. These are the two most common reasons for such kind of problem.
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.



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