utils

package
v1.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GcmIvLength                            = 12
	EktIdLength                            = 36
	EncryptApiName                         = "Encrypt"
	AsymmetricEncryptApiName               = "AsymmetricEncrypt"
	DecryptApiName                         = "Decrypt"
	AsymmetricDecryptApiName               = "AsymmetricDecrypt"
	AsymmetricSignApiName                  = "AsymmetricSign"
	AsymmetricVerifyApiName                = "AsymmetricVerify"
	GenerateDataKeyApiName                 = "GenerateDataKey"
	GenerateDataKeyWithoutPlaintextApiName = "GenerateDataKeyWithoutPlaintext"
	GetPublicKeyApiName                    = "GetPublicKey"
	GetSecretValueApiName                  = "GetSecretValue"
	DigestMessageType                      = "DIGEST"
	KMSKeySpecAES256                       = "AES_256"
	KMSKeySpecAES128                       = "AES_128"
	MigrationKeyVersionIdKey               = "x-kms-migrationkeyversionid"
	NumberOfBytesAes256                    = 32
	NumberOfBytesAes128                    = 16
	MagicNum                               = '$'
	MagicNumLength                         = 1
	CipherVerAndPaddingModeLength          = 1
	AlgorithmLength                        = 1
	CipherVer                              = 0
	AlgAesGcm                              = 2
	SDKName                                = "alibabacloud-kms-go-sdk"
	SDKVersion                             = "1.2.4"
	ClientUserAgent                        = SDKName + "-client/" + SDKVersion
	TransferClientUserAgent                = SDKName + "-transfer-client/" + SDKVersion
)
View Source
const (
	InvalidParamErrorCode                 = "InvalidParam"
	InvalidParameterErrorCode             = "InvalidParameter"
	UnauthorizedErrorCode                 = "Unauthorized"
	InvalidParamDateErrorMessage          = "The Param Date is invalid."
	InvalidParamAuthorizationErrorMessage = "The Param Authorization is invalid."
)

Variables

This section is empty.

Functions

func DecoderBytesToString

func DecoderBytesToString(data []byte, encoding string) (string, error)

func EncoderStringToBytes

func EncoderStringToBytes(plaintext string, encoding string) ([]byte, error)

func NewMissingParameterError

func NewMissingParameterError(paramName string) error

func TransferTeaErrorServerError

func TransferTeaErrorServerError(err error) error

Types

type ErrorContent

type ErrorContent struct {
	HttpCode  int
	RequestId string
	HostId    string
	Code      string
	Message   string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL