Exemplo n.º 1
0
        public static bool VerifyByPublicKey(byte[] originalData, byte[] signature, string publicKey, RsaKeyFormat format, HashAlgorithmName hashAlgorithmName, RSASignaturePadding padding)
        {
            var key      = RsaKeyGenerator.GeneratePublicKey(publicKey, format);
            var function = Factory.Create(key);

            return(function.VerifyByPublicKey(originalData, signature, hashAlgorithmName, padding));
        }
Exemplo n.º 2
0
        public static bool VerifyByPublicKey(string originalText, string signature, string publicKey, RsaKeyFormat format, HashAlgorithmName hashAlgorithmName, RSASignaturePadding padding, Encoding encoding = null)
        {
            var key      = RsaKeyGenerator.GeneratePublicKey(publicKey, format);
            var function = Factory.Create(key);

            return(function.VerifyByPublicKey(originalText, signature, hashAlgorithmName, padding, encoding));
        }
Exemplo n.º 3
0
        public static ISignValue SignByPublicKey(byte[] originalData, string publicKey, RsaKeyFormat format, HashAlgorithmName hashAlgorithmName)
        {
            var key      = RsaKeyGenerator.GeneratePublicKey(publicKey, format);
            var function = Factory.Create(key);

            return(function.SignByPublicKey(originalData, hashAlgorithmName));
        }
Exemplo n.º 4
0
        public static ISignValue SignByPublicKey(string originalText, string publicKey, RsaKeyFormat format, HashAlgorithmName hashAlgorithmName, Encoding encoding = null)
        {
            var key      = RsaKeyGenerator.GeneratePublicKey(publicKey, format);
            var function = Factory.Create(key);

            return(function.SignByPublicKey(originalText, hashAlgorithmName, encoding));
        }
Exemplo n.º 5
0
        public static ICryptoValue DecryptByPublicKey(string cipherText, string publicKey, RsaKeyFormat format, RSAEncryptionPadding padding, Encoding encoding = null)
        {
            var key      = RsaKeyGenerator.GeneratePublicKey(publicKey, format);
            var function = Factory.Create(key);

            return(function.DecryptByPublicKey(cipherText, padding, encoding));
        }
Exemplo n.º 6
0
        public static ICryptoValue DecryptByPublicKey(byte[] cipherData, string publicKey, RsaKeyFormat format, RSAEncryptionPadding padding)
        {
            var key      = RsaKeyGenerator.GeneratePublicKey(publicKey, format);
            var function = Factory.Create(key);

            return(function.DecryptByPublicKey(cipherData, padding));
        }
Exemplo n.º 7
0
        public static ICryptoValue EncryptByPublicKey(string originalText, string publicKey, RsaKeyFormat format, bool fOEAP, Encoding encoding = null)
        {
            var key      = RsaKeyGenerator.GeneratePublicKey(publicKey, format);
            var function = Factory.Create(key);

            return(function.EncryptByPublicKey(originalText, fOEAP, encoding));
        }
Exemplo n.º 8
0
        public static ICryptoValue EncryptByPublicKey(byte[] originalData, string publicKey, RsaKeyFormat format, bool fOEAP)
        {
            var key      = RsaKeyGenerator.GeneratePublicKey(publicKey, format);
            var function = Factory.Create(key);

            return(function.EncryptByPublicKey(originalData, fOEAP));
        }
Exemplo n.º 9
0
 public static IRSA CreateWithPublicKey(string key, RsaKeyFormat keyFormat) => new RsaFunction(RsaKeyGenerator.GeneratePublicKey(key, keyFormat));