예제 #1
0
 static void postProcessRow(AdcsDbRow row)
 {
     if (row.Properties.ContainsKey("CertificateTemplate") && !String.IsNullOrWhiteSpace(row.Properties["CertificateTemplate"]?.ToString()))
     {
         row.Properties.Add("CertificateTemplateOid", new Oid((String)row.Properties["CertificateTemplate"]));
     }
     if (row.Properties.ContainsKey("ExtensionName"))
     {
         row.Properties.Add("ExtensionNameOid", new Oid((String)row.Properties["ExtensionName"]));
     }
 }
예제 #2
0
        IEnumerable <AdcsDbRow> enumRows(Int32 skipRows, Int32 takeRows)
        {
            Int32 rowsTaken = 0;

            dbRow.Skip(skipRows);
            while (dbRow.Next() != -1 && rowsTaken < takeRows)
            {
                rowsTaken++;
                var row = new AdcsDbRow {
                    ConfigString = ConfigString,
                    Table        = table
                };
                enumColumnView(dbRow, row);
                postProcessRow(row);
                yield return(row);
            }
            dbRow.Reset();
        }
예제 #3
0
        static void enumColumnView(IEnumCERTVIEWROW dbRow, AdcsDbRow row)
        {
            IEnumCERTVIEWCOLUMN dbColumn = dbRow.EnumCertViewColumn();

            while (dbColumn.Next() != -1)
            {
                String colName = dbColumn.GetName();
                Object colVal  = dbColumn.GetValue(CertAdmConstants.CV_OUT_BASE64);
                switch (colName)
                {
                case "RequestID":
                case "ExtensionRequestId":
                case "AttributeRequestId":
                case "CRLRowId":
                    row.RowId = (Int32)colVal;
                    break;
                }
                row.Properties.Add(colName, colVal);
            }
            CryptographyUtils.ReleaseCom(dbColumn);
        }