summary refs log tree commit diff
path: root/crypto/src/asn1/BerNull.cs
blob: 0751bbac37a6c4947daeaf2f651dc749962e74ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;

namespace Org.BouncyCastle.Asn1
{
	/**
	 * A BER Null object.
	 */
	public class BerNull
		: DerNull
	{
		public static new readonly BerNull Instance = new BerNull(0);

		[Obsolete("Use static Instance object")]
		public BerNull()
		{
		}

		private BerNull(int dummy) : base(dummy)
		{
		}

		internal override void Encode(
			DerOutputStream  derOut)
		{
			if (derOut is Asn1OutputStream || derOut is BerOutputStream)
			{
				derOut.WriteByte(Asn1Tags.Null);
			}
			else
			{
				base.Encode(derOut);
			}
		}
	}
}