NBitcoin.BouncyCastle.Asn1.DerSequenceGenerator.AddObject C# (CSharp) Method

AddObject() public method

public AddObject ( Asn1Encodable obj ) : void
obj Asn1Encodable
return void
		public override void AddObject(
			Asn1Encodable obj)
		{
			new DerOutputStream(_bOut).WriteObject(obj);
		}

Usage Example

Ejemplo n.º 1
0
		/**
		* What we get back from the signer are the two components of a signature, r and s. To get a flat byte stream
		* of the type used by Bitcoin we have to encode them using DER encoding, which is just a way to pack the two
		* components into a structure.
		*/
		public byte[] ToDER()
		{
			// Usually 70-72 bytes.
			MemoryStream bos = new MemoryStream(72);
			DerSequenceGenerator seq = new DerSequenceGenerator(bos);
			seq.AddObject(new DerInteger(R));
			seq.AddObject(new DerInteger(S));
			seq.Close();
			return bos.ToArray();

		}
All Usage Examples Of NBitcoin.BouncyCastle.Asn1.DerSequenceGenerator::AddObject