EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SBPGPExceptions.EElPGPInvalidPacketException: Invalid PGP packet

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#1516
Posted: 10/23/2006 08:31:36
by Ken Ivanov (EldoS Corp.)

What exactly do you mean by 'corruption'? Are these bytes absent or incorrect?

Besides, is the .asc file loaded by PGPKeysDemo correctly?
#1517
Posted: 10/23/2006 08:33:33
by Rav Panesar (Basic support level)
Joined: 10/19/2006
Posts: 14

sorry i mean they are incorrect, they both have a length of 1185 but the last 60 are incorrect. I think the PGPKeys demo files are loaded correctly.
#1520
Posted: 10/23/2006 09:11:48
by Ken Ivanov (EldoS Corp.)

Just a guess... The 'Export key' button of PGPKeys demo application exports only a *public* key (i.e., the secret part of a key is not exported). Probably, that's the real reason for the problem (i.e., you are passing a public key to the TElPGPSecretKey.LoadFromStream() method). To teach the demo export secret keys too, please patch the ExportKey() method in the following way:
Code
   Private Sub ExportKey()
      Dim key As TElPGPPublicKey

        If (Not (tvKeyring.SelectedNode Is Nothing)) AndAlso (TypeOf tvKeyring.SelectedNode.Tag Is TElPGPPublicKey) Then
            key = tvKeyring.SelectedNode.Tag
            If (saveFileDialog.ShowDialog() = DialogResult.OK) Then
                key.SaveToFile(saveFileDialog.FileName, True)
                If Not (key.SecretKey Is Nothing) Then
                    key.SecretKey.SaveToFile(saveFileDialog.FileName + ".skr", True)
                End If
                Status("Key saved")
            End If
        End If
   End Sub
#1521
Posted: 10/23/2006 09:21:32
by Rav Panesar (Basic support level)
Joined: 10/19/2006
Posts: 14

Hi,

Now i am getting the following error
SBPGPExceptions.EElPGPInvalidKeyException: Invalid PGP key data at SBPGPKeys.TElPGPSecretKey.LoadFromStream(Stream Stream) at TestSSO_v1.SignAndEncryptToken() in c:\inetpub\wwwroot\PortalComponents\TestSSO_v1.aspx.vb:line 106

is there a number that i can go through with you just to see whether i am going wrong somewhere.

Thanks
#1522
Posted: 10/23/2006 09:35:39
by Ken Ivanov (EldoS Corp.)

Most likely, you are passing a public key to TElPGPSecretKey.LoadFromStream() method. Please check if the *secret* key is passed (it's header is 'BEGIN PGP PRIVATE KEY BLOCK').
#1523
Posted: 10/23/2006 09:40:19
by Rav Panesar (Basic support level)
Joined: 10/19/2006
Posts: 14

actually when looking at the code from the webconfig both headers say public key, so the question is how to use the PGPKeysdemo to convert a .gpg to a .asc file?
#1524
Posted: 10/23/2006 09:51:29
by Ken Ivanov (EldoS Corp.)

Please read one of my previous posts (10/23/2006 09:11:48), it describes how to improve PGPKeysDemo to make it support export of secret keys.
#1526
Posted: 10/23/2006 10:10:33
by Rav Panesar (Basic support level)
Joined: 10/19/2006
Posts: 14

Hi

I have read your post on the following URL

http://www.eldos.com/forum/read.php?FID=7&TID=108&MID=463&phrase_id=112506#message463

I used the keys demo in 2 different ways

1) I loaded a keyring and selected the public and private keys then exported them with the new code you sent.
2) I clicked the button add a key and then exported that

When I look at both the headers they are the same

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SecureBlackbox 4 (PGPBlackbox)

And

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SecureBlackbox 4 (PGPBlackbox)

The keys are slightly different at the bottom of both.

I just want to make sure I have the right private key in an .asc format, then I will re-test and let you know. Was I looking at the right post? If not could you please point me to the right URL.

Thanks
#1527
Posted: 10/23/2006 10:26:26
by Ken Ivanov (EldoS Corp.)

The demo improved in a way I described above creates two key files (e.g., 'mykey' and 'mykey.skr'). The first one contains a public key, and the second one stores a secret key. The header for the secret key should look like 'BEGIN PGP PRIVATE KEY BLOCK'.
#1528
Posted: 10/23/2006 10:32:59
by Rav Panesar (Basic support level)
Joined: 10/19/2006
Posts: 14

excellent that has worked, will now continue the code, thanks for the help.
Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.

Reply

Statistics

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