0

Can I retrieve public key by providing keyID.( I have imported the public key using kleopatra)

Note: I am currently passing the public key file path to encrypt the stream.I am successfully encrypting the stream without any issues using BountyCastle nuget package.

I have tried this:

  PgpPublicKeyRingBundle bun = new PgpPublicKeyRingBundle(new byte[200]);
  var publicc = bun.GetPublicKey(long.Parse("12ERTY564"));

Update: The above is test KeyID.

user2526236
  • 1,538
  • 2
  • 15
  • 29
  • 1
    Is `new byte[200]` just for demo purposes or something? – Maarten Bodewes Jun 15 '17 at 22:49
  • new byte[200] is just for demo. I would like to know if we can achieve this. – user2526236 Jun 16 '17 at 19:34
  • Well? What do you get as result? There is a `GetPublicKey` method that accepts a KeyID. The source code is there to be read. It's unlikely that the code does nothing. So what exactly is the question? Oh, uh, `"12ERTY564"` doesn't look like a `long` is that again for demo purposes or is this your actual problem? – Maarten Bodewes Jun 18 '17 at 22:22

0 Answers0