EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Invalid Armor Exception When Loading Public Key

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#10948
Posted: 09/03/2009 15:40:00
by Kurt Craver (Basic support level)
Joined: 09/03/2009
Posts: 2

I am using Secure Black Box .NET version 7.1.163 and getting an "invalid armor" Exception when attempting to load my PGP public key into a TElPGPKeyring.

Here is my public key :

Quote


-----BEGIN PGP PUBLIC KEY BLOCK-----

Version: Cryptocx v6.1.3



mQENBEmIaEIBCACiO4S5JDnuRVD7afqDTLpG1j6Dy+P+RiFOAen5+BkOMmul8OGS

KCe8C5XiO+WpHuUMQgq2gag+6g4xIcAHKprsVNHrmrHaariuzkoxR8LzuLGoEckt

CQVEjObUdAfFVeAw5EKEmwvceuHH84kev7iTj2jbqVLQtj4cTXhLZXSAP74Nti2D

TA6qsOvKcji9BMtdYN8ipZN9U+IWfyJr3YwOldzTUZQUYkZqK/HB0XOMBBNIDMjT

rC+Q6kS5oHXGStEmPIu2DFM8+kkelgVZ8Din7RncvpmGZGIE8KiMXdkYcXSiDXYL

+2eMdYLfUoIFYwLxQDZGra9p8duT0Tl9pcoLABEBAAG0DFR3aW5PYWtzMjAwOYkB

MAQQAQIAGgUCSYhoQgUJM3+YAAQLAwECAhkBBRsAAAAAAAoJEEtk944uQnk2G40H

/1YCJxgTAJInI4Ykw65lHDjeazofflTWnqf0F3BVt8VsBn0zM1Fp+cA1IC+jl3u3

csYWFnK4lFPH990+vXMtjI3a5tAiq2id9/cEgNt3S9K3h/U+t4ZrEJ0xivLUJy+c

2pJ83LMeCU/EZjl3A4k8N1fBB+1GZ8W2uXxA1w49KFqhiPjg/vL4G4zZu69vdsPH

29dnDdwBIzPXKnYwTNUNn0p+7V4QKvKQznDIhS3ua82fzZxoDKQR1JONPe6N5kRL

kU7QwEZf/Wy7pBeElwC6ZDAAN7uQCphVEul8ztmJtPbNXHuUN1Pt7A9BexCmmUAc

uKYxJTQ5PiDHSeZB8sIS+ia5AQ0ESYfPUAEIANwe8SoPhwt8wtvdjXdEPCuCM9u9

f/e4l4sWRt2lPEFs+Ys1KJ7yNMdLwcad1+1iHkrUO+zcOW6WKnT+EkM8Os+oIYCn

FJmszrDef87nWxsaqIoyFVtsgPCI7XoIC0vfS8n3CBOyVXg5/VOzFnRlYlvOGjEK

jto4X7CARtZ1hRZQTHD65hR2jZGN2X9sABb0PumljLvppvyRnyx6na6oY/JBV40X

RmHbyqvMauRH+K9ZZfGLcwly6+bCg2ziRTL/ZZfRAjkFPusiEr4PRmVasQio6Ex0

eedsUcO0HOJLpZDfAloChTmyfsOdnvjLuoKej6AJkXnLl8Zk92UD4l/C1tsAEQEA

AYkBIgQYAQIADAUCSYhrAAUbDAAAAAAKCRBLZPeOLkJ5NvubB/wMWxEbc68vi35F

ncFoRxrQv9NaOD3b8/dr6lEHvFmSeF22AINAsh0j2LQRQ/n6LZz0y+ZEhjWhClan

KznAkqE4x5yrLP79KQltfmH5SEdgvEfP1EtyWOJxE4fF4PjCPuLugNZdOKJ4ejfC

kdlPzgVkpqtnEwJHs8x+ougOLY0gbblcpRHTk2gZ+K4fangvC3NKnsQCq8KGDBDs

DPWoK51BRbXgnReW+nokyvxxJmSbE7zspFjHVdx2wKGslgYiPLAXMfPi8e+z70AN

Mtqib9UTx8Pi1c33PwDO0OR8qnN+Wt1ORdx8zq/0smVuHuHQ1Va9ENKaRreSZazH

UJ04ktZT

=3p9n

-----END PGP PUBLIC KEY BLOCK-----



Here is code that produces the "invalid armor" Exception when calling the TElPGPKeyring.Load method :

Code

TElPGPKeyring keyRing = new TElPGPKeyring();
keyRing.ArmorBoundary = "PGP PUBLIC KEY BLOCK";
keyRing.ArmorHeaders.Add("Version: Cryptocx v6.1.3");
keyRing.Load(Application.StartupPath + @"\PGPPublicKey.txt", null, true);


I get the same Exception when using a MemoryStream or when using a TElPGPPublicKey.

What am I missing? I assume I need to tweak the ArmorBoundry or ArmorHeaders properties slightly, but I'm not sure exactly what is wrong.

Thanks.
#10952
Posted: 09/04/2009 00:22:46
by Ken Ivanov (EldoS Corp.)

Thank you for contacting us.

Does the body of the key contain those empty lines between every two key data lines? Unfortunately, it is not clear from the key body you have posted. If yes, those empty lines are likely to be the reason for the problem. Please post the key file as the attachment so that we could get it in its original form.
#10965
Posted: 09/04/2009 08:03:03
by Kurt Craver (Basic support level)
Joined: 09/03/2009
Posts: 2

Thank you for your assistance.

There were indeed blank lines between each line of key text. Removing the blank lines fixed my issue.

Thanks again.

-Kurt

Reply

Statistics

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