public string getString() { StringBuilder buf = new StringBuilder("#"); MemoryStream bOut = new MemoryStream(); ASN1OutputStream aOut = new ASN1OutputStream(bOut); try { aOut.writeObject(this); } catch (IOException) { throw new Exception("internal error encoding BitString"); } byte[] str = bOut.ToArray(); for (int i = 0; i != str.Length; i++) { uint ubyte = (uint)str[i]; buf.Append(table[(ubyte >> 4) % 0xf]); buf.Append(table[str[i] & 0xf]); } return(buf.ToString()); }
public byte[] getEncoded() { MemoryStream bOut = new MemoryStream(); ASN1OutputStream aOut = new ASN1OutputStream(bOut); aOut.writeObject(this); return(bOut.ToArray()); }