public RevokeCertViewModel(ListItemEntry entry,Action<ListItemEntry,String, int,DateTime> revokeAction,
                           Action<object> closeAction)
 {
     _revokedSerial = new RevokedSerial();
     Certificate = entry.Certificate;
     RevokedSerial.Serial = Certificate.SerialNumber.ToString();
     this._revokeAction = revokeAction;
     this._closeAction = closeAction;
     this._entry = entry;
 }
Ejemplo n.º 2
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);
 }