Exemplo n.º 1
0
 public Signature(AuthenticodeInfo authenticodeInfo)
 {
     if (authenticodeInfo != null)
     {
         IsAuthenticodeValid = authenticodeInfo.IsAuthenticodeValid;
         SignedHash          = authenticodeInfo.SignedHash;
         SignerSerialNumber  = authenticodeInfo.SignerSerialNumber;
         SigningCertificate  = new SerializableCertificate(authenticodeInfo.SigningCertificate);
     }
 }
Exemplo n.º 2
0
 public Signature(AuthenticodeInfo authenticodeInfo)
 {
     if (authenticodeInfo != null)
     {
         IsAuthenticodeValid = authenticodeInfo.IsAuthenticodeValid;
         SignedHash          = Convert.ToBase64String(authenticodeInfo.SignedHash);
         SignerSerialNumber  = authenticodeInfo.SignerSerialNumber;
         SigningCertificate  = new SerializableCertificate(authenticodeInfo.SigningCertificate);
     }
     else
     {
         IsAuthenticodeValid = false;
     }
 }
Exemplo n.º 3
0
 public static Signature?GetSignatureStatus(string Path)
 {
     if (!NeedsSignature(Path))
     {
         return(null);
     }
     try
     {
         var peHeader         = new PeNet.PeFile(Path);
         var authenticodeInfo = new AuthenticodeInfo(peHeader);
         var sig = new Signature(authenticodeInfo);
         return(sig);
     }
     catch (Exception)
     {
     }
     return(null);
 }
Exemplo n.º 4
0
 public Signature(AuthenticodeInfo authenticodeInfo)
 {
     if (authenticodeInfo != null)
     {
         IsAuthenticodeValid = authenticodeInfo.IsAuthenticodeValid;
         if (authenticodeInfo.SignedHash is byte[] hash)
         {
             SignedHash = Convert.ToBase64String(hash);
         }
         SignerSerialNumber = authenticodeInfo.SignerSerialNumber;
         if (authenticodeInfo.SigningCertificate is X509Certificate2 cert)
         {
             SigningCertificate = new SerializableCertificate(cert);
         }
     }
     else
     {
         IsAuthenticodeValid = false;
     }
 }