{"id":19992083,"url":"https://github.com/stulzq/RSAUtil","last_synced_at":"2025-05-04T11:30:39.074Z","repository":{"id":60773423,"uuid":"116953253","full_name":"stulzq/RSAUtil","owner":"stulzq","description":".NET Core RSA algorithm using the help tool.It supports data encryption, decryption, signature and verification signature.It supports three key formats, namely: xml, pkcs1, pkcs8.It also supports key conversion for these three formats.Last also support pem formatting.","archived":false,"fork":false,"pushed_at":"2024-09-03T09:39:35.000Z","size":1689,"stargazers_count":281,"open_issues_count":1,"forks_count":83,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-08T10:27:02.187Z","etag":null,"topics":["dotnet-core","pem","rsa","rsa-convert","rsa-pkcs1","rsa-pkcs8","rsa-xml"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stulzq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-10T12:12:37.000Z","updated_at":"2025-01-14T02:51:24.000Z","dependencies_parsed_at":"2024-10-28T11:39:02.559Z","dependency_job_id":null,"html_url":"https://github.com/stulzq/RSAUtil","commit_stats":{"total_commits":42,"total_committers":4,"mean_commits":10.5,"dds":0.0714285714285714,"last_synced_commit":"5517f5f96fc18db7ba3babdc725ea32605ae5ed8"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stulzq%2FRSAUtil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stulzq%2FRSAUtil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stulzq%2FRSAUtil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stulzq%2FRSAUtil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stulzq","download_url":"https://codeload.github.com/stulzq/RSAUtil/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252329105,"owners_count":21730549,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet-core","pem","rsa","rsa-convert","rsa-pkcs1","rsa-pkcs8","rsa-xml"],"created_at":"2024-11-13T04:52:02.018Z","updated_at":"2025-05-04T11:30:37.001Z","avatar_url":"https://github.com/stulzq.png","language":"C#","readme":"# RSAUtil  [中文文档](https://github.com/stulzq/RSAUtil/blob/master/README_Chinese.md \"中文文档\")\n\n[![Build Status](https://ci2.xcmaster.com/job/RSAUtil/job/master/badge/icon)](https://ci2.xcmaster.com/job/RSAUtil/job/master/)\n\n.NET Core RSA algorithm using the help tool.It supports data encryption, decryption, signature and verification signature.It supports three key formats, namely: xml, pkcs1, pkcs8.It also supports key conversion for these three formats.Last also support pem formatting.\n\nThanks for onovotny's [bc-csharp](https://github.com/onovotny/bc-csharp \"bc-csharp\")\n\n[![Latest version](https://img.shields.io/nuget/v/XC.RSAUtil.svg?style=flat-square)](https://www.nuget.org/packages/XC.RSAUtil/)\n\n# Install\n\n````shell\nInstall-Package XC.RSAUtil\n````\n\n\u003e The old package name is `XC.Framework.Security.RSAUtil`. Now renamed `XC.RSAUtil` and will continue to use.\n\n# Doc\n\n### Generate the key\n\n\u003eUse class `RsaKeyGenerator`.The result returned is a list of two-element strings,Element 1 is the private key and element 2 is the public key.\n\nFormat: XML\n\n```csharp\nvar keyList = RsaKeyGenerator.XmlKey(2048);\nvar privateKey = keyList[0];\nvar publicKey = keyList[1];\n```\n\nFormat: Pkcs1\n\n```csharp\nvar keyList = RsaKeyGenerator.Pkcs1Key(2048);\nvar privateKey = keyList[0];\nvar publicKey = keyList[1];\n```\n\nFormat: Pkcs8\n\n```csharp\nvar keyList = RsaKeyGenerator.Pkcs8Key(2048);\nvar privateKey = keyList[0];\nvar publicKey = keyList[1];\n```\n\n### RSA key conversion\n\n\u003eUse class `RsaKeyConvert`.It  supports key conversion for these three formats,namely: xml, pkcs1, pkcs8.\n\n##### XML-\u003ePkcs1:\n\n- Private Key : `RsaKeyConvert.PrivateKeyXmlToPkcs1()`\n- Public Key  : `RsaKeyConvert.PublicKeyXmlToPem()`\n\n##### XML-\u003ePkcs8:\n\n- Private Key : `RsaKeyConvert.PrivateKeyXmlToPkcs8()`\n- Public Key  : `RsaKeyConvert.PublicKeyXmlToPem()`\n\n##### Pkcs1-\u003eXML:\n\n- Private Key : `RsaKeyConvert.PrivateKeyPkcs1ToXml()`\n- Public Key  : `RsaKeyConvert.PublicKeyPemToXml()`\n\n##### Pkcs1-\u003ePkcs8:\n\n- Private Key : `RsaKeyConvert.PrivateKeyPkcs1ToPkcs8()`\n- Public Key  : No conversion required\n\n##### Pkcs8-\u003eXML:\n\n- Private Key : `RsaKeyConvert.PrivateKeyPkcs8ToXml()`\n- Public Key  : `RsaKeyConvert.PublicKeyPemToXml()`\n\n##### Pkcs8-\u003ePkcs1:\n\n- Private Key : `RsaKeyConvert.PrivateKeyPkcs8ToPkcs1()`\n- Public Key  : No conversion required\n\n### Encrypt, decrypt, sign, and verify signatures\n\n\u003eXML, Pkcs1, Pkcs8 respectively corresponding categories: `RsaXmlUtil`, `RsaPkcs1Util`, `RsaPkcs8Util`.They inherit from the abstract class `RSAUtilBase`\n\n- Encrypt: `RSAUtilBase.Encrypt()`\n- Decrypt: `RSAUtilBase.Decrypt()`\n- Sign: `RSAUtilBase.SignData()`\n- Verify: `RSAUtilBase.VerifyData()`\n\n### PEM formatting\n\n\u003eUse class `RsaPemFormatHelper`.\n\n- Format Pkcs1 format private key: `RsaPemFormatHelper.Pkcs1PrivateKeyFormat()`\n\n- Remove the Pkcs1 format private key format: `RsaPemFormatHelper.Pkcs1PrivateKeyFormatRemove()`\n\n- Format Pkcs8 format private key: `RsaPemFormatHelper.Pkcs8PrivateKeyFormat()`\n\n- Remove the Pkcs8 format private key format: `RsaPemFormatHelper.Pkcs8PrivateKeyFormatRemove()`\n\n## Reference component\n\n [bc-csharp](https://github.com/onovotny/bc-csharp \"bc-csharp\") - onovotny\n\n## Cases\n\n[dotnetrsa](https://github.com/stulzq/dotnetrsa) - DotnetRSA is a .NET Core Global Tool.Dotnet RSA Tool can help you generate xml pkcs1, pkcs8 three kinds of format keys, and supports three types of mutual conversion. ","funding_links":[],"categories":["C\\#"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstulzq%2FRSAUtil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstulzq%2FRSAUtil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstulzq%2FRSAUtil/lists"}