public void Sign(string contentFilename, string thumbprint, string signatureFilename, bool useLocalSystemStorage = false) { var signatureContent = crypt.Sign(File.ReadAllBytes(contentFilename), crypt.GetCertificateWithPrivateKey(thumbprint, useLocalSystemStorage).RawData); File.Delete(signatureFilename); File.WriteAllBytes(signatureFilename, signatureContent); }