Exemple #1
0
 /// <summary>
 /// Removes Certificate Revocation List (CRL) flags from a specified Certification Authority. Multiple
 /// flags can be removed at the time.
 /// </summary>
 /// <param name="flags">One or more flags defined in <see cref="CRLFlagEnum"/> enumeration.</param>
 public void Remove(CRLFlagEnum flags)
 {
     Int32[] existing = EnumFlags.GetEnabled(typeof(CRLFlagEnum), (Int32)CRLFlags);
     Int32[] newf     = EnumFlags.GetEnabled(typeof(CRLFlagEnum), (Int32)flags);
     foreach (int item in newf.Where(item => EnumFlags.Contains(existing, item)))
     {
         CRLFlags   = (CRLFlagEnum)((Int32)CRLFlags - item);
         IsModified = true;
     }
 }
Exemple #2
0
 /// <summary>
 /// Adds Certificate Revocation List (CRL) flags to enable on a specified Certification Authority. Multiple
 /// flags can be added at the time.
 /// </summary>
 /// <param name="flags">One or more flags defined in <see cref="CRLFlagEnum"/> enumeration.</param>
 /// <exception cref="ArgumentException">The data in the <strong>flags</strong> parameter
 /// contains Certificate Revocation List flags that are not supported by a current Certification Authority version.</exception>
 public void Add(CRLFlagEnum flags)
 {
     Int32[] existing = EnumFlags.GetEnabled(typeof(CRLFlagEnum), (Int32)CRLFlags);
     Int32[] newf     = EnumFlags.GetEnabled(typeof(CRLFlagEnum), (Int32)flags);
     if (
         Version == "2000" ||
         Version == "2003" ||
         Version == "2008" &&
         ((Int32)flags & (Int32)CRLFlagEnum.DisableChainVerification) != 0 ||
         ((Int32)flags & (Int32)CRLFlagEnum.BuildRootCACRLEntriesBasedOnKey) != 0)
     {
         throw new ArgumentException();
     }
     foreach (int item in newf.Where(item => !EnumFlags.Contains(existing, item)))
     {
         CRLFlags   = (CRLFlagEnum)((Int32)CRLFlags + item);
         IsModified = true;
     }
 }