Base class for DER encoded data.
Ejemplo n.º 1
0
 public void WriteTest()
 {
     DerData target = new DerData(); // TODO: Initialize to an appropriate value
     bool data = false; // TODO: Initialize to an appropriate value
     target.Write(data);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Ejemplo n.º 2
0
 public void IsEndOfDataTest()
 {
     DerData target = new DerData(); // TODO: Initialize to an appropriate value
     bool actual;
     actual = target.IsEndOfData;
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 /// <summary>
 /// Called when type specific data need to be loaded.
 /// </summary>
 protected override void LoadData()
 {
     this.ResetReader();
     this.KS = this.ReadBinaryString();
     this.QS = this.ReadDerData();
     this.Signature = this.ReadDerData();
 }
Ejemplo n.º 4
0
 public void ReadIntegerTest()
 {
     DerData target = new DerData(); // TODO: Initialize to an appropriate value
     int expected = 0; // TODO: Initialize to an appropriate value
     int actual;
     actual = target.ReadInteger();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Ejemplo n.º 5
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.º 6
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.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Key"/> class.
        /// </summary>
        /// <param name="data">DER encoded private key data.</param>
        public Key(byte[] data)
        {
            if (data == null)
                throw new ArgumentNullException("data");

            var der = new DerData(data);
            var version = der.ReadBigInteger();

            var keys = new List<BigInteger>();
            while (!der.IsEndOfData)
            {
                keys.Add(der.ReadBigInteger());
            }

            this._privateKey = keys.ToArray();
        }
Ejemplo n.º 8
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.º 9
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);
        }
Ejemplo n.º 10
0
 public void DerDataConstructorTest1()
 {
     byte[] data = null; // TODO: Initialize to an appropriate value
     DerData target = new DerData(data);
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Ejemplo n.º 11
0
 public void DerDataConstructorTest()
 {
     DerData target = new DerData();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Ejemplo n.º 12
0
 public void WriteTest4()
 {
     DerData target = new DerData(); // TODO: Initialize to an appropriate value
     ObjectIdentifier identifier = new ObjectIdentifier(); // TODO: Initialize to an appropriate value
     target.Write(identifier);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Called when type specific data need to be loaded.
 /// </summary>
 protected override void LoadData()
 {
     this.ResetReader();
     this.QC = this.ReadDerData();
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KeyExchangeEcdhInitMessage"/> class.
 /// </summary>
 /// <param name="clientExchangeValue">The client exchange value.</param>
 public KeyExchangeEcdhInitMessage(DerData clientExchangeValue)
 {
     this.QC = clientExchangeValue;
 }