Tag: 公钥

C#中已签名程序集的公钥结构是什么?

使用此代码检索公钥字节… var pubKey = AppDomain.CurrentDomain.DomainManager.EntryAssembly .GetName().GetPublicKey(); 密钥的开头(前32个字节)的这种常见结构是什么? 它不是ASN.1,它可能不是变量。 我可以谷歌并获得重复。 // 00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 是全部逆转还是只是其中的一部分(例如最后的模数)? 52 53 41 31是一串RSA1 。 我的密钥模数是1024位,所以我一直在寻找描述长度的东西。 0x0400 ( 00 04 BE)为1024(位), 0x80为128(字节,1024/8)。 // 00 04 00 00 01 00 01 […]

Windows中公钥和私钥的容器位置?

我试图使用以下代码将我的公钥和私钥存储在容器中: CspParameters cp = new CspParameters(); cp.KeyContainerName = “Test”; RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(cp); 我想知道的是容器的位置。 容器在文件系统中的位置是什么?

c#RSA从私钥中提取公钥

有没有办法从c#中的私钥中提取公钥? 如果我做了ToXMLString()那么我可以设置是否需要使用私钥保存的公钥信息。 所以现在我认为有一种方法可以从私有中提取公钥吗?

如何从C#中的文件加载RSA公钥

我需要从文件加载以下RSA公钥以与RSACryptoServiceProvider类一起使用。 我怎样才能做到这一点? —–BEGIN PUBLIC KEY—– XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/syEKqEkMtQL0+d XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX+izR KbGMRtur2TYklnyVkjeeHfAggo8vWQmWesnOG55vQYHbOOFoJbk0EkwEr5R/PbKm byXPPN8zwnS5/XXXXXXXXXXXX —–END PUBLIC KEY—– 此代码适用于我的pub键: http : //www.jensign.com/opensslkey/ 这是我正在使用的代码 static string RSA(string input) { RSACryptoServiceProvider rsa = DecodeX509PublicKey(Convert.FromBase64String(GetKey())); return (Convert.ToBase64String(rsa.Encrypt(Encoding.ASCII.GetBytes(input), false))); } static string GetKey() { return File.ReadAllText(“master.pub”).Replace(“—–BEGIN PUBLIC KEY—–“, “”).Replace(“—–END PUBLIC KEY—–“, “”); //.Replace(“\n”, “”); } private static bool CompareBytearrays(byte[] a, byte[] b) { if (a.Length […]