KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've had a application using Bouncy Castle for PGP decryption which has run without any issues for the past 8 months or so, and the past 2 days all of a sudden an issue has come up where the GetDataStream method is throwing an exception: Exception Message: "error setting asymmetric cipher". Inner Exception Message : "Not an RSA key". private static PgpObjectFactory getClearDataStream(PgpPrivateKey privateKey, PgpPublicKeyEncryptedData publicKeyED) { // Exception throws here. Stream clearStream = publicKeyED.GetDataStream(privateKey); PgpObjectFactory clearFactory = new PgpObjectFactory(clearStream); return clearFactory; } The key hasn't expired, it has no expiration date: I haven't made any changes to the application, I haven't touched the keys, so I can't quite understand why an issue has come up out of the blue. Any ideas? I can also manually decrypt the files using Kleopatra using the same keys that I load in the application. Update 1 - I downloaded the free trial for OpenPGP Library for .NET , which looks to use BouncyCastle also, and I have no issues decrypting the files using the same key. For some reason, my implementation of decryption using BouncyCastle that has worked for several months stopped working for some reason that I have not been able to identify yet. Update 2 - I pulled files from last week that worked, and I've also downloaded the source code of BouncyCastle in order that I can step through and debug to see where the exception is throwing and how the variables differ between a file that works and a file that doesn't work. The exception is being thrown at the beginning of the GetDataStream method of the PgpPublicKeyEncryptedData class: byte[] plain = fet
Tags (comma-separated)
Save Edits
Cancel