Beispiel #1
0
        public static SatoPrivateKey FromPem(string input)
        {
            var key = Pem.Decode <AsymmetricKeyParameter>(input);

            if (key == null)
            {
                var key2 = Pem.Decode <AsymmetricCipherKeyPair>(input);
                if (key2 == null)
                {
                    return(null);
                }

                key = key2.Private;
            }

            return(new SatoPrivateKey(key));
        }
 public string ToPem() => Pem.Encode(_key);
        public static SatoKeyPair FromPem(string input)
        {
            var keyPair = Pem.Decode <AsymmetricCipherKeyPair>(input);

            return(new SatoKeyPair(new SatoPrivateKey(keyPair.Private), new SatoPublicKey(keyPair.Public)));
        }