ConstructSegmentedSequence() статический приватный Метод

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[][]
Результат byte[][]
Пример #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))
                       ));
        }
Пример #2
0
        internal static byte[] ToSubjectPublicKeyInfo(this ECParameters parameters)
        {
            parameters.Validate();

            if (!parameters.Curve.IsNamed)
            {
                throw new PlatformNotSupportedException(SR.Cryptography_ECC_NamedCurvesOnly);
            }

            byte[] pointBlob = GetPointBlob(ref parameters);

            return(DerEncoder.ConstructSequence(
                       DerEncoder.ConstructSegmentedSequence(
                           s_encodedIdEcPublicKey,
                           DerEncoder.SegmentedEncodeOid(parameters.Curve.Oid)),
                       DerEncoder.SegmentedEncodeBitString(pointBlob)));
        }