Beispiel #1
0
        private static Tuple <bool, string> PedrinhoRecebeEValidaMensagem(string cripto, string signa)
        {
            var signaOK  = EasyRSA.RSAFactory("Felipe", false).VerifySignature(cripto, signa);
            var decripto = EasyRSA.RSAFactory("Pedrinho", true).Decrypt(cripto);

            return(new Tuple <bool, string>(signaOK, decripto));
        }
Beispiel #2
0
        private static Tuple <string, string> FelipeCriaMensagem(string mensagemOriginal)
        {
            var cripto = EasyRSA.RSAFactory("Pedrinho", false).Encrypt(mensagemOriginal);
            var signa  = EasyRSA.RSAFactory("Felipe", true).Sign(cripto);

            return(new Tuple <string, string>(cripto, signa));
        }
Beispiel #3
0
        public static EasyRSA RSAFactory(string name, bool privateKey)
        {
            var easyRsa = new EasyRSA(name);

            easyRsa.LoadRSA(privateKey);

            return(easyRsa);
        }