package alipay

import (
	"testing"
)

func TestCertSN(t *testing.T) {
	ms, err := getMchCertSN("/Users/lsxd/code/php/yxxt/market/config/alipaycash/appCertPublicKey_2021004100663111.crt")
	if err != nil {
		t.Error(err)
	} else {
		//78a57140055b8e7853b1576bcf763361
		//78a57140055b8e7853b1576bcf763361
		t.Logf("merchantCertSN:%s", ms)
	}
	rs, err := getRootCertSN("/Users/lsxd/code/php/yxxt/market/config/alipaycash/alipayRootCert.crt")
	if err != nil {
		t.Error(err)
	} else {
		//687b59193f3f462dd5336e5abf83c5d8_02941eef3187dddf3d3b83462e1dfcf6
		//687b59193f3f462dd5336e5abf83c5d8_02941eef3187dddf3d3b83462e1dfcf6
		t.Logf("alipayRootCertSN:%s", rs)
	}
}

func TestMchCertSN(t *testing.T) {
	s, err := getMchCertSN("/Users/lsxd/code/php/yxxt/market/config/alipaycash/appCertPublicKey_2021004100663111.crt")
	if err != nil {
		t.Error(err)
	} else {
		//78a57140055b8e7853b1576bcf763361
		t.Log(s)
	}
}

func TestRootCertSN(t *testing.T) {
	s, err := getRootCertSN("/Users/lsxd/code/php/yxxt/market/config/alipaycash/alipayRootCert.crt")
	if err != nil {
		t.Error(err)
	} else {
		t.Log(s)
	}
}

func TestPublicKey(t *testing.T) {
	s, err := getPublicKey("/Users/lsxd/code/php/yxxt/market/config/alipaycash/alipayCertPublicKey_RSA2.crt")
	if err != nil {
		t.Error(err)
	} else {
		//78a57140055b8e7853b1576bcf763361
		t.Log(s)
	}
}