Пример #1
0
 public void RemoveRevokedSerial(String serial)
 {
     if (File.Exists(RevokedSerialsFile))
         _revoked = RevokedSerials.Deserialize(RevokedSerialsFile);
     else
     {
         _revoked = new RevokedSerials();
     }
     _revoked[serial] = null;
     RevokedSerials.Serialize(_revoked, RevokedSerialsFile);
 }
Пример #2
0
 /// <summary>
 /// Checks wether the given serial is in revoked serials list
 /// </summary>
 /// <param name="serial"></param>
 /// <returns></returns>
 public bool IsRevokedCertificate(String serial)
 {
     if (_revoked == null)
     {
         _revoked = RevokedSerials.Deserialize(RevokedSerialsFile);
         //_revokedSerials = new List<String>(Regex.Split(File.ReadAllText(RevokedSerialsFile), Environment.NewLine));
     }
     return _revoked[serial] != null; //_revokedSerials.Contains(serial);
 }
Пример #3
0
 public static void Serialize(RevokedSerials rs, string path)
 {
     SerializeUtils.SerializeToXml(rs, path);
 }
Пример #4
0
 /// <summary>
 /// Adds the specified serial to revoked certs file
 /// </summary>
 /// <param name="serial">serial number of the certiifcate to revoke</param>
 /// <param name="reason"> reason to revoke</param>
 /// <param name="dateTime">date time of revoke</param>
 public void AddRevokedSerial(String serial, int reason, DateTime dateTime)
 {
     if (_revoked == null)
     {
         if (File.Exists(RevokedSerialsFile))
             _revoked = RevokedSerials.Deserialize(RevokedSerialsFile);
         else
         {
             _revoked = new RevokedSerials();
         }
     }
     _revoked[serial] = new RevokedSerial {Reason = reason, RevocationDate = dateTime, Serial = serial};
     RevokedSerials.Serialize(_revoked, RevokedSerialsFile);
     //File.AppendAllText(RevokedSerialsFile, serial + Environment.NewLine);
     //RefreshRevokedSerialsList(serial);
 }
Пример #5
0
 public static void Serialize(RevokedSerials rs,string path)
 {
     SerializeUtils.SerializeToXml(rs,path);
 }