Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        public byte[] getEncoded()
        {
            MemoryStream     bOut = new MemoryStream();
            ASN1OutputStream aOut = new ASN1OutputStream(bOut);

            aOut.writeObject(this);

            return(bOut.ToArray());
        }