Exemplo n.º 1
0
        public AesCryptoProviderTests(ITestOutputHelper output)
        {
            using (var aes = Aes.Create())
            {
                aes.GenerateKey();
                _iv = aes.IV;
                var key = Encoding.Unicode.GetString(aes.Key);

                _keystore = new InsecureKeyStore("mypublickey", "!mysecretkey#9^5");
            }
            _output = output;
        }
Exemplo n.º 2
0
        public RsaCryptoProviderTests()
        {
            using (var rsa = RSA.Create())
            {
                rsa.KeySize = 2048;
                var privateKey = rsa.ExportParameters(true);
                var publicKey  = rsa.ExportParameters(false);

                _keystore = new InsecureKeyStore(
                    new KeyValuePair <string, string>("privateKey", GetKeyAsString(privateKey)),
                    new KeyValuePair <string, string>("publicKey", GetKeyAsString(publicKey)));
            }
        }
Exemplo n.º 3
0
 public RsaCryptoProvider(IKeystoreProvider keyStore) : this()
 {
     KeyStore = keyStore;
 }