Bug 235467. Mark binary keys as binary types when persisting data.

This commit is contained in:
Jim Norman
2007-01-16 05:54:11 +00:00
parent 6a23194273
commit 1b73394fc7
5 changed files with 59 additions and 12 deletions

View File

@@ -1435,6 +1435,8 @@ public class MiCasa : Store
SecretStore ss = GetMiCasaStore();
Secret secret = ss.GetSecret(entrySecretID.Text);
value = secret.GetKeyValue(selected);
// strip of header data
byte[] baValue = System.Text.Encoding.ASCII.GetBytes(value);
@@ -1458,8 +1460,19 @@ public class MiCasa : Store
Glade.XML gxmlTemp = new Glade.XML(Common.GladeFile, "dialogDecode", null);
gxmlTemp.Autoconnect(this);
// display values
textviewClear.Buffer.Text = value;
// display decoded value
//textviewClear.Buffer.Text = value;
char[] array = value.ToCharArray();
try
{
byte[] bytes = Convert.FromBase64CharArray(array, 0, array.Length);
textviewClear.Buffer.Text = System.Text.Encoding.ASCII.GetString(bytes);
}
catch (Exception e)
{
textviewClear.Buffer.Text = e.ToString();
}
// hook up button handlers
bttnDecode.Clicked += new EventHandler(bttnDecode_Clicked);