Encode() public method

Encodes written data as DER byte array.
public Encode ( ) : byte[]
return byte[]
Ejemplo n.º 1
0
 public void EncodeTest()
 {
     DerData target = new DerData(); // TODO: Initialize to an appropriate value
     byte[] expected = null; // TODO: Initialize to an appropriate value
     byte[] actual;
     actual = target.Encode();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Encodes hash using DER.
        /// </summary>
        /// <param name="hashData">The hash data.</param>
        /// <returns>DER Encoded byte array</returns>
        protected byte[] DerEncode(byte[] hashData)
        {
            var alg = new DerData();
            alg.Write(_oid);
            alg.WriteNull();

            var data = new DerData();
            data.Write(alg);
            data.Write(hashData);
            return data.Encode();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Writes DerData data into internal buffer.
 /// </summary>
 /// <param name="data">DerData data to write.</param>
 public void Write(DerData data)
 {
     var bytes = data.Encode();
     this._data.AddRange(bytes);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Writes DerData data into internal buffer.
        /// </summary>
        /// <param name="data">DerData data to write.</param>
        public void Write(DerData data)
        {
            var bytes = data.Encode();

            _data.AddRange(bytes);
        }