Hestia.Security 1.1.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package Hestia.Security --version 1.1.5                
NuGet\Install-Package Hestia.Security -Version 1.1.5                
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="Hestia.Security" Version="1.1.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hestia.Security --version 1.1.5                
#r "nuget: Hestia.Security, 1.1.5"                
#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.
// Install Hestia.Security as a Cake Addin
#addin nuget:?package=Hestia.Security&version=1.1.5

// Install Hestia.Security as a Cake Tool
#tool nuget:?package=Hestia.Security&version=1.1.5                

Hestia.Security

alternate text is missing from this package README image alternate text is missing from this package README image


应用场景

微信支付V2

签名

https://pay.weixin.qq.com/wiki/doc/api/micropay.php?chapter=4_1

  • MD5
    • HASH/MD5/Test2
  • HMAC-SHA256
    • MAC/HMAC_SHA256/Test2

微信支付V3

签名

https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay3_3.shtml

  • SHA256withRSA

证书和回调报文解密

https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay3_2.shtml

  • AES/GCM/NoPadding

敏感信息加解密

https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay4_3.shtml

  • RSA/ECB/OAEPWithSHA-1AndMGF1Padding

微信第三方平台

消息加解密

https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Before_Develop/Technical_Plan.html

  • AES/CBC/NoPadding
    • CRYPTO/AES_CBC_NOPADDING/Test3
    • CRYPTO/AES_CBC_NOPADDING/Test4
  • SHA1
    • HASH/SHA1/Test3

微信小程序

签名

https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html

  • SHA1
    • HASH/SHA1/Test2

服务端获取开放数据

https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html

  • AES/CBC/PKCS7PADDING
    • CRYPTO/AES_CBC_PKCS7PADDING/Test3
    • CRYPTO/AES_CBC_PKCS7PADDING/Test4

钉钉企业内部应用

消息订阅加密解密

https://open.dingtalk.com/document/org/configure-event-subcription

  • AES/CBC/NOPADDING
    • CRYPTO/AES_CBC_NOPADDING/Test5
    • CRYPTO/AES_CBC_NOPADDING/Test6
  • SHA1
    • HASH/SHA1/Test4

钉钉机器人

自定义机器人签名

https://open.dingtalk.com/document/robots/customize-robot-security-settings

  • HMAC-SHA256
    • MAC/HMAC_SHA256/Test3

阿里云接口

签名

https://help.aliyun.com/document_detail/315526.html

  • HMAC-SHA1
    • MAC/HMAC_SHA1/Test2

阿里云 API 网关

JWT 签名

https://help.aliyun.com/document_detail/177489.html

  • SHA256withRSA
    • SIGN/SHA256_WITH_RSA/Test4

财政电子票据对接报文消息摘要

财政电子票据对接报文规范-开票报文

财政电子票据对接报文规范-入账报文

财政电子票据对接报文规范-数据交换报文

附录B-消息摘要

  • SHA256
    • HASH/SHA256/Test2
  • SM3
    • HASH/SM3/Test2
// https://www.jdoodle.com/online-java-compiler-ide/
// Test on JDK 17.0.1
// lib add commons-codec:commons-codec:1.15
import org.apache.commons.codec.digest.DigestUtils;
// lib add org.bouncycastle:bcprov-jdk15on:1.70
import org.bouncycastle.crypto.digests.SM3Digest;
import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;

import java.io.UnsupportedEncodingException;

public class CzClass {
    public static void main(String args[]) {
        String xml ="<?xml version='1.0' encoding='UTF-8'?><Invoice><Head><MsgNo>8901</MsgNo><Version>1.0</Version><AppId>KPQZDWB5629411</AppId><MsgId>20190522213800999</MsgId><DateTime>20190522213800999</DateTime><Resvered></Resvered></Head><Msg>PFZvdWNoZXI+PFBsYWNlQ29kZT4wMDE8L1BsYWNlQ29kZT48L1ZvdWNoZXI+</Msg></Invoice>";
		System.out.println("xml:"+xml);
		String APP_KEY = "TEST_APP_KEY";
        System.out.println("APP_KEY:"+APP_KEY);
		String source = APP_KEY + xml;
		System.out.println("source:"+source);
		
		// sha256
		String sha256 = org.apache.commons.codec.digest.DigestUtils.sha256Hex(source);
		System.out.println("sha256:"+sha256);
		
		// sm3
		try {
    		byte[] data = source.getBytes("UTF-8");
    		SM3Digest digest = new SM3Digest();
    		digest.update(data, 0, data.length);
            byte[] hash = new byte[digest.getDigestSize()];
            digest.doFinal(hash, 0);
            String sm3 = ByteUtils.toHexString(hash);
            System.out.println("sm3:"+sm3);
		} catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
    }
}
xml:<?xml version='1.0' encoding='UTF-8'?><Invoice><Head><MsgNo>8901</MsgNo><Version>1.0</Version><AppId>KPQZDWB5629411</AppId><MsgId>20190522213800999</MsgId><DateTime>20190522213800999</DateTime><Resvered></Resvered></Head><Msg>PFZvdWNoZXI+PFBsYWNlQ29kZT4wMDE8L1BsYWNlQ29kZT48L1ZvdWNoZXI+</Msg></Invoice>
APP_KEY:TEST_APP_KEY
source:TEST_APP_KEY<?xml version='1.0' encoding='UTF-8'?><Invoice><Head><MsgNo>8901</MsgNo><Version>1.0</Version><AppId>KPQZDWB5629411</AppId><MsgId>20190522213800999</MsgId><DateTime>20190522213800999</DateTime><Resvered></Resvered></Head><Msg>PFZvdWNoZXI+PFBsYWNlQ29kZT4wMDE8L1BsYWNlQ29kZT48L1ZvdWNoZXI+</Msg></Invoice>
sha256:09be4a8404ae81630c4bc6fb6c58df816a724d48e7ff2dd22ff79d87e43f342a
sm3:34a137b8bba3b6eefbee72eac423eddefc67048ba9e1fa725139ad596e8dedf4

链上公益

接口加解密

  • RSA/ECB/PKCS1Padding
  • AES/ECB/PKCS5Padding
  • SHA256
  • SHA-256withRSA

TOTP

  • HMAC-SHA1
    • Utility/OTP/Test9

感谢

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Hestia.Security:

Package Downloads
Hestia.Logging.DingTalk

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.8 144 4/3/2024
1.1.7 173 9/6/2023
1.1.6 179 7/3/2023
1.1.5 213 4/10/2023
1.1.4 297 2/9/2023
1.1.3 784 9/30/2022
1.1.2 425 9/13/2022
1.1.1 421 9/13/2022
1.1.0 417 9/8/2022
1.0.2 429 8/5/2022
1.0.1 454 7/20/2022
1.0.0 529 5/7/2022