Esempio n. 1
0
        public string GenerateToken(string email, int validaityOffsetInMinutes = 10)
        {
            var userData = CreateUserData(email);
            Trace.Write(userData);

            lock (lockThis)
            {
                var gpg = new GnuPgpProcessor();
                var signedData = gpg.Sign(Config.Passphrase, userData);
                Trace.Write(signedData);
                var encryptedData = gpg.Encrypt(Config.Recipient, signedData);
                Trace.Write(encryptedData);
                return EncodeUserData(encryptedData);
            }
        }
Esempio n. 2
0
        public string GenerateToken(string email, int validaityOffsetInMinutes = 10)
        {
            var userData = CreateUserData(email);

            Trace.Write(userData);

            lock (lockThis)
            {
                var gpg        = new GnuPgpProcessor();
                var signedData = gpg.Sign(Config.Passphrase, userData);
                Trace.Write(signedData);
                var encryptedData = gpg.Encrypt(Config.Recipient, signedData);
                Trace.Write(encryptedData);
                return(EncodeUserData(encryptedData));
            }
        }
Esempio n. 3
0
 public void Sign_BadPassphrase_ExpectException()
 {
     var service = new GnuPgpProcessor();
     var token = service.Sign("dsdsfsfsdf", "dsfksldfksfd");
 }