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

SegmentedEncodeUnsignedInteger() static private method

Encode the segments { tag, length, value } of an unsigned integer.
static private SegmentedEncodeUnsignedInteger ( byte bigEndianBytes ) : byte[][]
bigEndianBytes byte The value to encode, in big integer representation.
return byte[][]
        internal static byte[][] SegmentedEncodeUnsignedInteger(byte[] bigEndianBytes)
        {
            Debug.Assert(bigEndianBytes != null);

            return SegmentedEncodeUnsignedInteger(bigEndianBytes, 0, bigEndianBytes.Length);
        }

Same methods

DerEncoder::SegmentedEncodeUnsignedInteger ( byte bigEndianBytes, int offset, int count ) : byte[][]

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::SegmentedEncodeUnsignedInteger