cryptdata

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CryptData

type CryptData struct {
	Payload string `json:"payload" binding:"required"`
	// contains filtered or unexported fields
}

func (*CryptData) DecryptPayload

func (c *CryptData) DecryptPayload(base64Payload string, base64KeyInput string) ([]byte, error)

DecryptPayload descriptografa um payload que foi criptografado usando AES-CBC. Espera-se que base64Payload seja Base64(bytes_crus_IV + bytes_crus_Ciphertext).

func (*CryptData) EncryptPayload

func (c *CryptData) EncryptPayload(jsonDataBytes []byte) (string, error)

EncryptPayload criptografa os jsonDataBytes fornecidos (que devem ser dados JSON já serializados) usando AES-CBC. O output é uma string Base64 no formato: Base64(bytes_crus_IV + bytes_crus_Ciphertext). Utiliza a chave global 'base64Key' definida no pacote.

func (*CryptData) PayloadData

func (c *CryptData) PayloadData(base64Payload string) ([]byte, error)

PayloadData é uma função wrapper que descriptografa usando a chave global do pacote.

type CryptDataInterface

type CryptDataInterface interface {
	PayloadData(base64Payload string) ([]byte, error)
	DecryptPayload(base64Payload string, base64KeyInput string) ([]byte, error)
	EncryptPayload(jsonDataBytes []byte) (string, error)
	CryptDataInternalInterface
}

func InicializationCryptData

func InicializationCryptData(token *string) (CryptDataInterface, error)

type CryptDataInternalInterface

type CryptDataInternalInterface interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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