public static byte[] SignWithCertificate(string message, Pkcs12Store x509Certificate) { return(x509Certificate.PrivateKey().SignData(Encoding.UTF8.GetBytes(message))); }