Renci.SshNet.Common.DerData.Write C# (CSharp) Method

Write() public method

Writes INTEGER data into internal buffer.
public Write ( BigInteger data ) : void
data BigInteger BigInteger data to write.
return void
        public void Write(BigInteger data)
        {
            var bytes = data.ToByteArray().Reverse();
            _data.Add(Integer);
            var length = GetLength(bytes.Length);
            WriteBytes(length);
            WriteBytes(bytes);
        }

Same methods

DerData::Write ( DerData data ) : void
DerData::Write ( ObjectIdentifier identifier ) : void
DerData::Write ( bool data ) : void
DerData::Write ( byte data ) : void
DerData::Write ( uint data ) : void

Usage Example

        /// <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();
        }
All Usage Examples Of Renci.SshNet.Common.DerData::Write