func (g GcpKms) crypto(payload []byte, projectid, locationid, keyringid,
	cryptokeyid, keyname string, encrypt bool) (resultText []byte, err error) {
	kmsService := kmsClient()
	var parentName string
	if len(keyname) > 0 {
		parentName = keyname
	} else {
		parentName = fmt.Sprintf(
			"projects/%s/locations/%s/keyRings/%s/cryptoKeys/%s", projectid,
			locationid, keyringid, cryptokeyid)
	}
	if encrypt {
		resultText, err = googleKMSEncrypt(payload, parentName, kmsService)
	} else {
		resultText, err = googleKMSDecrypt(payload, parentName, kmsService)
	}
	return
}
// uses google kms to either encrypt or decrypt a byte slice
uses google kms to either encrypt or decrypt a byte slice
// uses google kms to either encrypt or decrypt a byte slice
func (g GcpKms) crypto(payload []byte, projectid, locationid, keyringid,
	cryptokeyid, keyname string, encrypt bool) (resultText []byte, err error) {
	kmsService := kmsClient()
	var parentName string
	if len(keyname) > 0 {
		parentName = keyname
	} else {
		parentName = fmt.Sprintf(
			"projects/%s/locations/%s/keyRings/%s/cryptoKeys/%s", projectid,
			locationid, keyringid, cryptokeyid)
	}
	if encrypt {
		resultText, err = googleKMSEncrypt(payload, parentName, kmsService)
	} else {
		resultText, err = googleKMSDecrypt(payload, parentName, kmsService)
	}
	return
}
func ( g GcpKms ) crypto ( payload [ ] byte , projectid , locationid , keyringid , cryptokeyid , keyname string , encrypt bool ) ( resultText [ ] byte , err error ) { kmsService := kmsClient ( ) var parentName string if len ( keyname ) > 0 { parentName = keyname } else { parentName = fmt . Sprintf ( " " , projectid , locationid , keyringid , cryptokeyid ) } if encrypt { resultText , err = googleKMSEncrypt ( payload , parentName , kmsService ) } else { resultText , err = googleKMSDecrypt ( payload , parentName , kmsService ) } return }
uses google kms to either encrypt or decrypt a byte slice
uses google kms to either encrypt or decrypt a byte slice