31 lines
802 B
Go
31 lines
802 B
Go
package util
|
|
|
|
import (
|
|
"log"
|
|
"testing"
|
|
)
|
|
|
|
func TestCallbackEncrypt(t *testing.T) {
|
|
|
|
}
|
|
|
|
func TestCallbackSignature(t *testing.T) {
|
|
|
|
}
|
|
|
|
func TestDecryptAndVerify(t *testing.T) {
|
|
var keyid = "KYLxo7PUriwwvr436Pvms1zj"
|
|
var timestamp = "20240514140352"
|
|
var nonce = "CGXanb4Lm6AY7A1arMi9QXrs"
|
|
var signvalue = "0o/lgrPc9oQ+WPShmYehCNl87VfTBd/bU+uw0aCDJN8b89X087MkHEmah/pAwP+tMnNeDI+GziLGBAEqgMqpQQ=="
|
|
var body = "ZomY/SeGJNimC6dwuwbOiGXwmw14ZymmaMAwk0IMDqSP2Tg3V3G2jRX3E+zr1HwY"
|
|
var decrypt_key = "k40Dt+bgq56QYSheW0B3Lg=="
|
|
var public_key = "BMWZI1sHxDBM0MVVKZn18ni7hPEwfxQoobZRQBEh0ea0oEr5sCLDnipF4bIjLeuNhj6bU5QdnP8EvnIxoL2u8YY="
|
|
verify, _ := DecryptAndVerify(keyid, timestamp, nonce, signvalue, body, decrypt_key, public_key)
|
|
log.Println(verify)
|
|
}
|
|
|
|
func TestDecryptAndVerify2(t *testing.T) {
|
|
|
|
}
|