EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Importing Multiple Keys....

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#8692
Posted: 01/22/2009 13:10:03
by Dilmer Valecillos (Basic support level)
Joined: 12/08/2008
Posts: 4

Hi all, I'm trying to find out if there's a method within the TElPGPKeyring that will allow loading multiple keys from a file, currently I know that I can call TElPGPPublicKey.LoadFromFile to import an individual key from a file, but what about if I like to import multiple keys that reside in the same file?

This is the code that I have to import one key:


TElPGPKeyring keyRingTemp = new TElPGPKeyring();
TElPGPPublicKey tempKey = new TElPGPPublicKey();

tempKey.LoadFromFile(keyFilename);
keyRingTemp.AddPublicKey(tempKey);
keyRingTemp.ExportTo(_keyRing);

#8693
Posted: 01/22/2009 13:28:45
by Mykola Olshevsky (Basic support level)
Joined: 07/07/2005
Posts: 450

Hi. The exact idea of keyring(s) is to store, and load multiple keys from one file (or two - for public and secret keys).
For such purpose you should use keyring.Load() method.
But this is only applicable for multiple keys, stored in binary format. Keys in ASCII format are used for export purpose, and you should load them one by one.
#8694
Posted: 01/22/2009 13:33:56
by Dilmer Valecillos (Basic support level)
Joined: 12/08/2008
Posts: 4

So let me give you an example:

I've the keyrings located on my C:\PGP\Secring and Pubring\ I know I can load both using the keyring.Load and pass in both references to the actual path, but what about if I have a keys store in a file that was exported from by PGP application? If I like to import one by one how does the keyring know how many keys are in the ACS file ? or else I can load the ACS file using the keyring.Load?

Please let me know thanks!
#8695
Posted: 01/22/2009 13:49:22
by Mykola Olshevsky (Basic support level)
Joined: 07/07/2005
Posts: 450

If more than one key is exported to the file, TElPGPKeyring.Load() method will load all of them, including secret and public keys (even if those are mixed in one file).
#8696
Posted: 01/22/2009 13:54:59
by Dilmer Valecillos (Basic support level)
Joined: 12/08/2008
Posts: 4

Thank you for your quick response, I'll go ahead and test it...
Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.

Reply

Statistics

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