<commit_before>﻿using System;
using System.Security.Cryptography;
using System.Text;

namespace DotCommon.Encrypt
{
    public class RsaEncryptor
    {
        private string PrivateKeyPem { get; set; }
        private string PublicKeyPem { get; set; }
        private string HashAlg { get; set; } = "RSA2";
        private RSASignaturePadding SignaturePadding { get; set; } = RSASignaturePadding.Pkcs1;
        private RSAEncryptionPadding EncryptionPadding { get; set; } = RSAEncryptionPadding.Pkcs1;


        public RsaEncryptor()
        {

        }
        public RsaEncryptor(string publicKeyPem, string privateKeyPem) : this(publicKeyPem, privateKeyPem, "RSA2")
        {
        }

        public RsaEncryptor(string publicKeyPem, string privateKeyPem, string hashAlg)
        {
            PublicKeyPem = publicKeyPem;
            PrivateKeyPem = privateKeyPem;
            HashAlg = hashAlg;
        }

        /// <summary>设置算法
        /// </summary>
        public RsaEncryptor SetHashAlg(string hashAlg)<commit_msg>增加RSA加密说明 Signed-off-by: virtual <<EMAIL>><commit_after>﻿using System;
using System.Security.Cryptography;
using System.Text;

namespace DotCommon.Encrypt
{
    /// <summary>RSA加密解密,签名验签
    /// </summary>
    public class RsaEncryptor
    {
        private string PrivateKeyPem { get; set; }
        private string PublicKeyPem { get; set; }
        private string HashAlg { get; set; } = "RSA2";
        private RSASignaturePadding SignaturePadding { get; set; } = RSASignaturePadding.Pkcs1;
        private RSAEncryptionPadding EncryptionPadding { get; set; } = RSAEncryptionPadding.Pkcs1;


        public RsaEncryptor()
        {

        }
        public RsaEncryptor(string publicKeyPem, string privateKeyPem) : this(publicKeyPem, privateKeyPem, "RSA2")
        {
        }

        public RsaEncryptor(string publicKeyPem, string privateKeyPem, string hashAlg)
        {
            PublicKeyPem = publicKeyPem;
            PrivateKeyPem = privateKeyPem;
            HashAlg = hashAlg;
        }

        /// <summary>设置算法
        /// </summary>
        public RsaEncryptor SetHashAlg(string hashAlg)
{'fraction_non_alphanumeric': 0.08746492048643592, 'fraction_numerical': 0.0037418147801683817, 'mean_word_length': 2.5008183306055645, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '915243', 'n_tokens_mistral': 689, 'n_tokens_neox': 664, 'n_words': 140}