WeComKit.Core 1.0.0

dotnet add package WeComKit.Core --version 1.0.0
                    
NuGet\Install-Package WeComKit.Core -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WeComKit.Core" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WeComKit.Core" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="WeComKit.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WeComKit.Core --version 1.0.0
                    
#r "nuget: WeComKit.Core, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WeComKit.Core@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WeComKit.Core&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=WeComKit.Core&version=1.0.0
                    
Install as a Cake Tool

WeComKit.Core

WeComKit.Core 提供企业微信 / 微信公众号集成中最基础的协议工具,不依赖 HTTP 客户端,可单独用于回调处理、后台服务或 Web API。

WeComKit.Core provides protocol-level helpers for WeCom / WeChat Work and WeChat public account integrations. It has no HTTP client dependency and can be used independently in callback handlers, background workers, and web APIs.

功能 / Features

  • 回调签名验证。 / Callback signature verification.
  • 企业微信 / 微信公众号消息加解密。 / WeCom / WeChat callback message encryption and decryption.
  • 会话存档 encrypt_random_key RSA 解密辅助。 / RSA helper for message-audit encrypt_random_key.
  • 微信小程序加密数据解密。 / WeChat mini-program encrypted data decryption.

安装 / Install

dotnet add package WeComKit.Core --version 1.0.0

回调消息解密 / Callback Decryption

using WeComKit.Core;

var crypt = new WeComMessageCrypt(token, encodingAesKey, corpId);
var plainXml = crypt.VerifyAndDecrypt(msgSignature, timestamp, nonce, encrypted);

签名验证 / Signature Verification

using WeComKit.Core;

var ok = WeComUtility.VerifySignature(token, signature, timestamp, nonce);

注意事项 / Notes

  • EncodingAESKey 必须是企业微信或微信后台配置的 43 位密钥。 / EncodingAESKey must be the 43-character value configured in WeCom or WeChat.
  • 解密时如果提供 CorpId/AppId,会校验消息尾部的 CorpId/AppId。 / CorpId/AppId is checked during message decryption when provided.
  • 企业微信机器人回调的 receiveid 可能为空,此时不要传入 CorpId 做尾部校验。 / Bot callbacks may have an empty receiveid; in that case do not pass CorpId for tail validation.
  • 无效 padding、无效消息长度、CorpId/AppId 不匹配都会抛异常。 / Invalid padding, invalid message length, and mismatched CorpId/AppId throw.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on WeComKit.Core:

Package Downloads
WeComKit.MsgAudit

企业微信会话存档 SDK 托管封装,线程安全、支持异步、显式加载官方原生 SDK。

WeComKit.Api

企业微信 API 客户端:AccessToken、OAuth、通讯录、素材、应用消息、机器人 webhook、第三方应用 suite 授权。

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 128 5/24/2026

First stable release for WeCom and WeChat protocol helpers, callback signature verification, message cryptography, RSA helper, and mini-program data decryption.