DotNet.Authorize/Entity/RSAKeyInfo.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Text;

namespace DotNet.Authorize
{
    public class RSAKeyInfo
    {
        public byte[] Modulus;
        public byte[] Exponent;
        public byte[] D;
        public byte[] DP;
        public byte[] P;
        public byte[] Q;
        public byte[] DQ;
        public byte[] InverseQ;
        public string PublicKey;
        public string PrivateKey;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="publicKey">公钥</param>
        public RSAKeyInfo(DotNet.Authorize.RSAPublicKey publicKey)
        {
            Exponent = publicKey.Exponent;
            Modulus = publicKey.Modulus;
            PublicKey = publicKey.PublicKey;   
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="privateKey">私钥</param>
        public RSAKeyInfo(DotNet.Authorize.RSAPrivateKey privateKey)
        {
            D = privateKey.D;
            DP = privateKey.DP;
            DQ = privateKey.DQ;
            Exponent = privateKey.Exponent;
            InverseQ = privateKey.InverseQ;
            Modulus = privateKey.Modulus;
            P = privateKey.P;
            Q = privateKey.Q;
            PrivateKey = privateKey.PrivateKey;
        }

        #region 组合/解析密钥

        /// <summary>
        /// 组合成密钥字符串
        /// </summary>
        /// <param name="b1"></param>
        /// <param name="b2"></param>
        /// <returns></returns>
        public static string ComponentKey(byte[] b1, byte[] b2)
        {
            List<byte> list = new List<byte>();
            //在前端加上第一个数组的长度值 这样今后可以根据这个值分别取出来两个数组
            list.Add((byte)b1.Length);
后面还有 36 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。