package encrypt

import (
	"voucher/internal/pkg/cmb/encrypt/pojo"
)

type (
	ApiCrypt interface {
		Encrypt(data string) (encryptData []byte, err error)
		Decrypt(encryptData string) (decryptData []byte, err error)
	}

	Rsa struct {
		App *AppEncrypt
	}

	SM2 struct {
		App *AppEncrypt
	}

	SM4 struct {
		App *AppEncrypt
	}

	AppEncrypt struct {
		UniKEY            string
		MerchantPublicKey string
		PublicKey         string
		PrivateKey        string
	}
)

var ApiCryptMap = map[int32]func(en *AppEncrypt) ApiCrypt{
	//pojo.RSA: NewRsa,
	pojo.SM2: NewSm2,
	pojo.SM4: NewSm4,
}

const CryptNotError = 0
