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

ConstructSegmentedSequence() static private method

Make a constructed SEQUENCE of the byte-triplets of the contents, but leave the value in a segmented form (to be included in a larger SEQUENCE).
static private ConstructSegmentedSequence ( ) : byte[][]
return byte[][]
        internal static byte[][] ConstructSegmentedSequence(params byte[][][] items)
        {
            Debug.Assert(items != null);

            byte[] data = ConcatenateArrays(items);

            return new byte[][]
            {
                new byte[] { ConstructedSequenceTag }, 
                EncodeLength(data.Length),
                data,
            };
        }

Usage Example

Beispiel #1
0
        internal static byte[] ToSubjectPublicKeyInfo(this DSAParameters parameters)
        {
            // SubjectPublicKeyInfo::= SEQUENCE  {
            //    algorithm AlgorithmIdentifier,
            //    subjectPublicKey     BIT STRING  }

            // Dss-Parms ::= SEQUENCE {
            //   p INTEGER,
            //   q INTEGER,
            //   g INTEGER
            // }

            return(DerEncoder.ConstructSequence(
                       DerEncoder.ConstructSegmentedSequence(
                           DerEncoder.SegmentedEncodeOid(s_idDsa),
                           DerEncoder.ConstructSegmentedSequence(
                               DerEncoder.SegmentedEncodeUnsignedInteger(parameters.P),
                               DerEncoder.SegmentedEncodeUnsignedInteger(parameters.Q),
                               DerEncoder.SegmentedEncodeUnsignedInteger(parameters.G)
                               )
                           ),
                       DerEncoder.SegmentedEncodeBitString(
                           DerEncoder.SegmentedEncodeUnsignedInteger(parameters.Y))
                       ));
        }
All Usage Examples Of System.Security.Cryptography.DerEncoder::ConstructSegmentedSequence