Beispiel #1
0
 private void SetFieldsFromDirectoryObject()
 {
     Version              = Convert.ToInt32(DirEntry.Properties[PropertyIndex.Version].Value);
     ExtendedKeyUsages    = ExtendedKeyUsage.GetEKUs(DirEntry);
     KeyUsages            = KeyUsage.GetKeyUsages((byte[])DirEntry.Properties[PropertyIndex.KeyUsage].Value);
     RASignaturesRequired = (int)DirEntry.Properties[PropertyIndex.RASignaturesRequired].Value;
     MinimumKeySize       = (int)DirEntry.Properties[PropertyIndex.MinimumKeySize].Value;
     Oid             = DirEntry.Properties[PropertyIndex.OID].Value.ToString();
     ValidityPeriod  = ((byte[])DirEntry.Properties[PropertyIndex.ValidityPeriod].Value).ToTimeSpan();
     PrivateKeyFlags = (int)DirEntry.Properties[PropertyIndex.PrivateKeyFlags].Value;
 }
        private static ExtendedKeyUsage FindByOid(string oid)
        {
            ExtendedKeyUsage eku = Supported.FirstOrDefault(p => p.OID.Matches(oid));

            if (eku == null)
            {
                return(new ExtendedKeyUsage(oid));
            }
            else
            {
                return(eku);
            }
        }