Class MerchantUtility
4G MDK マーチャント向けユーティリティクラス
Inheritance
object
MerchantUtility
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: jp.veritrans.tercerog.mdk
Assembly: cg-mdk.dll
Syntax
public class MerchantUtility
Methods
CheckMessage(MerchantConfig, string, string)
HMAC検証処理
Declaration
public static bool CheckMessage(MerchantConfig merchantConfig, string msgBody, string sContentHmac)
Parameters
Type | Name | Description |
---|---|---|
MerchantConfig | merchantConfig | 設定情報管理クラス |
string | msgBody | msgBody 受信電文の本文(Message-Body) |
string | sContentHmac | 受信電文に付属していた比較用 HMAC(Content-HMAC)。 ヘッダ情報に載っている文字列をそのまま渡す。 例)h=HmacSHA1;s=M123456789;v=f51ea2b7df5e239dc11d90050849ac03d363221a |
Returns
Type | Description |
---|---|
bool | true 検証OK or false 検証NG |
CheckMessage(string, string, string)
HMAC検証処理 マルチマーチャント対応
Declaration
public static bool CheckMessage(string secretKey, string msgBody, string sContentHmac)
Parameters
Type | Name | Description |
---|---|---|
string | secretKey | secretKey マーチャント認証鍵 |
string | msgBody | msgBody 受信電文の本文(Message-Body) |
string | sContentHmac | 受信電文に付属していた比較用 HMAC(Content-HMAC)。 ヘッダ情報に載っている文字列をそのまま渡す。 例)h=HmacSHA1;s=M123456789;v=f51ea2b7df5e239dc11d90050849ac03d363221a |
Returns
Type | Description |
---|---|
bool | true 検証OK or false 検証NG |
GetSecret(string)
Content-HMAC文字列からマーチャントシークレットを取り出す.
Declaration
public static string GetSecret(string sContentHmac)
Parameters
Type | Name | Description |
---|---|---|
string | sContentHmac | 受信電文に付属していた比較用 HMAC(Content-HMAC) ヘッダ情報に載っている文字列をそのまま渡す。 例)h=HmacSHA1;s=M123456789;v=f51ea2b7df5e239dc11d90050849ac03d363221a |
Returns
Type | Description |
---|---|
string | Content-HMAC文字列の【s=】の部分(マーチャントCCID) |