コード例 #1
0
        //converts from RSA Public Key format to X509 Subject Key Info format
        private string Rsa2X509Convert(string rsaPublicKey)
        {
            using (RsaKey rsaKey = new CryptRsaKey())
            {
                rsaKey.Init();

                var key = Encoder.DecodeToBytes(rsaPublicKey, EncodeMethod.Base64);
                rsaKey.SetRsaPublicKey(key);
                key = rsaKey.GetPublicKeyInfo();

                var result = Encoder.Encode(key, EncodeMethod.Base64);
                return(result);
            }
        }