Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpbcgr.RdpbcgrDecoder.ParseX509CertificateChain C# (CSharp) Method

ParseX509CertificateChain() private method

Parse X509 Certificate Chain (parser index is updated according to parsed length)
private ParseX509CertificateChain ( byte data, int &currentIndex, int size ) : X509_CERTIFICATE_CHAIN
data byte data to be parsed
currentIndex int current parser index
size int cert data size
return X509_CERTIFICATE_CHAIN
        private X509_CERTIFICATE_CHAIN ParseX509CertificateChain(byte[] data, ref int currentIndex, int size)
        {
            X509_CERTIFICATE_CHAIN cert = new X509_CERTIFICATE_CHAIN();

            cert.NumCertBlobs = (int)ParseUInt32(data, ref currentIndex, false);
            for (int i = 0; i < cert.CertBlobArray.Length; i++)
            {
                cert.CertBlobArray[i].cbCert = (int)ParseUInt32(data, ref currentIndex, false);
                cert.CertBlobArray[i].abCert = GetBytes(data, ref currentIndex, cert.CertBlobArray[i].cbCert);
            }
            cert.Padding = GetBytes(data, ref currentIndex, 8 + 4 * cert.NumCertBlobs);

            return cert;
        }
RdpbcgrDecoder