Beispiel #1
0
        public static string FromPublicKey(string publicKey)
        {
            var     publicKeyBlob = Convert.FromBase64String(publicKey).Skip(8).Take(64).ToArray();
            PemPart pem           = PemPart.BuildPublicKeyPack(publicKeyBlob);

            return(pem.BuildPublicKeyPem());
        }
Beispiel #2
0
        public static string FromKeyPair(string privateKey, string publicKey)
        {
            var     privateKeyBlob = Convert.FromBase64String(privateKey).Skip(8 + 64).Take(32).ToArray();
            var     publicKeyBlob  = Convert.FromBase64String(publicKey).Skip(8).Take(64).ToArray();
            PemPart pem            = PemPart.BuildPemPart(privateKeyBlob, publicKeyBlob);

            return(pem.BuildPem());
        }
Beispiel #3
0
        public static string FromPublicKey(byte[] publicKey)
        {
            PemPart pem = PemPart.BuildPublicKeyPack(publicKey);

            return(pem.BuildPublicKeyPem());
        }
Beispiel #4
0
        public static string FromKeyPair(byte[] privateKey, byte[] publicKey)
        {
            PemPart pem = PemPart.BuildPemPart(privateKey, publicKey);

            return(pem.BuildPem());
        }