Exception Types

22 views
Skip to first unread message

Jonny Wilson

unread,
Sep 24, 2013, 11:27:06 AM9/24/13
to didisof...@googlegroups.com
Apologies if this is a stupid question but - can you tell my where I can access the exception TYPE?
For example: I try to decrypt a message not intended for my private key, the library throws an exception (with message):

Decryption of data encrypted using KEY-ID(s) : 4153E840 failed, no matching key was found in the KeyStore.

How can I access the Exception Type to check against in the catch block?

Thank you in advance!
Jonny



didisoft

unread,
Sep 24, 2013, 11:38:33 AM9/24/13
to didisof...@googlegroups.com
Hi Jonny,

At the end of each chapter in the online tutorial you can find a topic "Exception Handling"

For example here is that topic in the chapter for OpenPGP decrypting:

Best Regards,
Peter Kalef
DidiSoft Technical Support


Jonny Wilson

unread,
Sep 24, 2013, 12:08:24 PM9/24/13
to didisof...@googlegroups.com
Fantastic - thank you!

Jonny Wilson

unread,
Sep 24, 2013, 12:08:54 PM9/24/13
to didisof...@googlegroups.com
I did see this in the past, I forgot it was there.  My apologies.


On Tuesday, 24 September 2013 16:27:06 UTC+1, Jonny Wilson wrote:

Jorge Riva

unread,
Apr 13, 2016, 6:38:00 PM4/13/16
to DidiSoft Forum
Hi, I have the same error, but this happens when i try to decrypt a file in Windows Server 2012, in windows 10 there is no problem with the same key/file.
Capture.PNG
Capture2.PNG

Jorge Riva

unread,
Apr 13, 2016, 6:42:51 PM4/13/16
to DidiSoft Forum
I'm using this code

            var keyStore = KeyStore.OpenInMemory();
            keyStore.ImportKeyRing("c:\users\user\documents\pgp\secring.skr");

            var pgp = new PGPLib();

            pgp.DecryptFile("file.csv.pgp", keyStore, "PGP Test key", "file.csv");

Jorge Riva

unread,
Apr 13, 2016, 6:45:59 PM4/13/16
to DidiSoft Forum
it only fails with one private key, the other ones in the Windows Server 2012 are working ok,

didisoft

unread,
Apr 14, 2016, 3:11:05 AM4/14/16
to DidiSoft Forum
Hi Jorge,

Can you try on the Windows 2012 server to execute this code against the same KeyStore:

bool hasPrivateKey = keyStore.ContainsPrivateKey("2AB64399");

and check the result.

Best,
Peter Kalef
Reply all
Reply to author
Forward
0 new messages