EldoS | Feel safer!

Software components for data protection, secure storage and transfer


Posted: 02/01/2008 04:13:58
by Thomas Br├╝ggemann (Standard support level)
Joined: 02/01/2008
Posts: 4


I want to save the generated public key into a bytebuffer. (.NET 2.0, C# VS 2005, SBB 6.x)
The Method SavePublicKey(...) always returns with SB_ERROR_SSH_KEYS_BUFFER_TOO_SMALL = 3335.

m_FKey.Comment = "Service";
int iStatus = m_FKey.Generate(m_FKey.Algorithm, ALGORITHM_BITS);
if (iStatus == 0)
   int KeyLen = 0;
   byte[] blobPublicKey = new byte[16384];
   string strPublicKey;
   iStatus = m_FKey.SavePublicKey(ref blobPublicKey, ref KeyLen, SBUtils.TSBEOLMarker.emCRLF);
   blobPublicKey = new byte[KeyLen];
   iStatus = m_FKey.SavePublicKey(ref blobPublicKey, ref KeyLen, SBUtils.TSBEOLMarker.emCRLF);
   strPublicKey = Encoding.ASCII.GetString(blobPublicKey, 0, KeyLen).Replace("\n", "\r\n");
   strPublicKey.Insert(0,"from=\"" + strHostname + "\" environment=\"User=Service\"");
   KeyLen = Encoding.ASCII.GetByteCount(strPublicKey);
   blobPublicKey = new byte[KeyLen];
   blobPublicKey = Encoding.ASCII.GetBytes(strPublicKey);
   iStatus = m_FKey.LoadPublicKey(blobPublicKey, KeyLen);
return iStatus;

What's wrong with my code?


Thomas Brueggemann
Posted: 02/01/2008 04:38:21
by Ken Ivanov (Team)

Your code is completely correct. The problem seems to be introduced in one of SBB 6 beta builds. We will prepare the fix and include it into the upcoming SBB6 beta 4 build.

Thank you for reporting the problem.



Topic viewed 1317 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!