EldoS | Feel safer!

Software components for data protection, secure storage and transfer

No appropriate key for decryption found

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#2441
Posted: 03/02/2007 09:54:32
by Matthew Dragiff (Standard support level)
Joined: 03/01/2007
Posts: 15

using the v.5.0.0.107 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?

#2442
Posted: 03/02/2007 10:35:11
by Ken Ivanov (EldoS Corp.)

Please consider using TElPGPReader.KeyPassphrase property for specifying a passphrase instead of TElPGPReader.Passphrase.
#2443
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...
#2444
Posted: 03/02/2007 13:07:06
by Ken Ivanov (EldoS Corp.)

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.
#2445
Posted: 03/02/2007 14:00:37
by Eugene Mayevski (EldoS Corp.)

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


Sincerely yours
Eugene Mayevski
#4871
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.
#4873
Posted: 02/07/2008 01:38:46
by Ken Ivanov (EldoS Corp.)

First, please try to upgrade to the latest available version (5.2.124) and check if the issue still exists.
#4892
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);

try
{
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;

try
{
pgpReader.DecryptAndVerify(inF, 0);

}
#4894
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.
#4895
Posted: 02/07/2008 09:49:35
by Ken Ivanov (EldoS Corp.)

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: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.

Reply

Statistics

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