private static void GeneratePublicKey()
        {
            var service = new AsymmetricEncryptionService();
            var pair    = service.GenerateKeyPairPem();

            Console.WriteLine(pair.Item2);
        }
Beispiel #2
0
        public void GenerateNewPair()
        {
            var pair = _service.GenerateKeyPairPem();

            var inlinePublicKey  = pair.GetPublicKey().Replace("\r\n", @"\r\n");
            var inlinePrivateKey = pair.GetPrivateKey().Replace("\r\n", @"\r\n");

            _testOutputHelper.WriteLine("Inline public key:");
            _testOutputHelper.WriteLine(inlinePublicKey);

            _testOutputHelper.WriteLine("Inline private key:");
            _testOutputHelper.WriteLine(inlinePrivateKey);

            _testOutputHelper.WriteLine("Public key:");
            _testOutputHelper.WriteLine(pair.GetPublicKey());

            _testOutputHelper.WriteLine("Private key:");
            _testOutputHelper.WriteLine(pair.GetPrivateKey());
        }