EldoS | Feel safer!

Software components for data protection, secure storage and transfer

load RSA Key for OpenPGP

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#11661
Posted: 11/13/2009 05:43:16
by Frank Munsberg (Standard support level)
Joined: 06/04/2009
Posts: 47

I've tried loading an RSA public key via

SBPGPKeys.TElPGPPublicKey publicKey = new SBPGPKeys.TElPGPPublicKey();
publicKey.LoadFromFile("keyfile.key");

it fails with
SBPGPExceptions.EElPGPInvalidKeyException : Invalid PGP key data

Is it even possible to load an RSA key here? I guess I'm mixing up key types

Also, the TElPGPPublicKey.LoadFromFile method accepts a OpenPGP public Keyring. Is that intended? If so, how does it decide which one of the keyfiles in the keyring it will load?

Greetings
Frank
#11662
Posted: 11/13/2009 06:01:59
by Eugene Mayevski (EldoS Corp.)

Quote
Frank Munsberg wrote:
I guess I'm mixing up key types


Exactly. What is your goal? What are you trying to accomplish by loading the RSA key into OpenPGP key?

Quote
Frank Munsberg wrote:
Also, the TElPGPPublicKey.LoadFromFile method accepts a OpenPGP public Keyring. Is that intended?


Yes. Saved key is a keyring with one key.

Quote
Frank Munsberg wrote:
If so, how does it decide which one of the keyfiles in the keyring it will load?


First the keyring is loaded into TElPGPKeyring object, than the public key with index 0 (the first key in the keyring) is copied into the object, whose LoadFrom...() method you are calling.


Sincerely yours
Eugene Mayevski
#11689
Posted: 11/16/2009 04:57:48
by Frank Munsberg (Standard support level)
Joined: 06/04/2009
Posts: 47

Quote
Eugene Mayevski wrote:
Exactly. What is your goal? What are you trying to accomplish by loading the RSA key into OpenPGP key?


Well, I thought using RSA Keys for PGP encryption was possible. Let's say I was a little confused and it was a friday...

Thanks for clearing that stuff up!
#11692
Posted: 11/16/2009 13:30:19
by Eugene Mayevski (EldoS Corp.)

Well, RSA key(pair) is a format and an algorithm. You can generate OpenPGP key pair which is based on RSA as a PKI algorithm (the alternative is to generate 2 keypairs for signing and encryption: DSS keypair for signing + ElGamal for encryption). You can even create an OpenPGP key which will use the given existing RSA keys and not generate new keys. But unless you know what you are doing and why you need it, you don't need those details. Modern PGP software uses DSS+ElGamal (a key is a DSS key and subkey is ElGamal).


Sincerely yours
Eugene Mayevski

Reply

Statistics

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