System.Security.Cryptography.DerEncoder.SegmentedEncodeBoolean C# (CSharp) Method

SegmentedEncodeBoolean() static private method

Encode the segments { tag, length, value } of a boolean.
static private SegmentedEncodeBoolean ( bool value ) : byte[][]
value bool The boolean to encode
return byte[][]
        internal static byte[][] SegmentedEncodeBoolean(bool value)
        {
            // BER says FALSE is zero, TRUE is other.
            // DER says TRUE is 0xFF.
            byte[] data =
            {
                (byte)(value ? 0xFF : 0x00),
            };

            return new byte[][]
            {
                new byte[] { (byte)DerSequenceReader.DerTag.Boolean }, 
                new byte[] { 0x01 }, 
                data, 
            };
        }