C# Class Example.Example.VerifyDemo

Show file Open project: PingPlusPlus/pingpp-csharp

Public Methods

Method Description
Example ( ) : bool

本示例介绍如何验证 webhooks 签名。 需要注意的是 requestBody 必须是接收到的原始数据; 签名在 header 里的 x-pingplusplus-signature 字段里; 公钥在管理平台里面,需要登陆去获取。

ReadFileToString ( string path ) : string
VerifySignedHash ( string strDataToVerify, string strSignedData, string strPublicKeyFilePath ) : bool

Method Details

Example() public static method

本示例介绍如何验证 webhooks 签名。 需要注意的是 requestBody 必须是接收到的原始数据; 签名在 header 里的 x-pingplusplus-signature 字段里; 公钥在管理平台里面,需要登陆去获取。
public static Example ( ) : bool
return bool

ReadFileToString() public static method

public static ReadFileToString ( string path ) : string
path string
return string

VerifySignedHash() public static method

public static VerifySignedHash ( string strDataToVerify, string strSignedData, string strPublicKeyFilePath ) : bool
strDataToVerify string
strSignedData string
strPublicKeyFilePath string
return bool