package
0.0.0-20240917120716-8843776e9f3a
Repository: https://github.com/cossacklabs/acra.git
Documentation: pkg.go.dev
# Functions
CreateAcrastruct encrypt your data using acra_public key and context (optional) and pack into correct Acrastruct format.
DecryptAcrastruct returns plaintext data from AcraStruct, decrypting it using Themis SecureCell in Seal mode, using optional additional context and privateKey as decryption key.
DecryptRotatedAcrastruct tries decrypting an AcraStruct with a set of rotated keys.
ExtractAcraStruct return AcraStruct that stored at start of data and return size in bytes of parsed AcraStructLength.
GetDataLengthFromAcraStruct unpack data length value from AcraStruct.
GetMinAcraStructLength returns minimal length of AcraStruct because in golang we can't declare byte array as constant we need to calculate length of TagBegin in runtime or hardcode as constant and maintain len(TagBegin) == CONST_VALUE.
ProcessAcraStructs find AcraStructs in inBuffer, call processor on every recognized AcraStruct and replace it with result into outBuffer until end of data from inBuffer or any error result On error it returns inBuffer as is.
ValidateAcraStructLength check that data has minimal length for AcraStruct and data block equal to data length in AcraStruct.
# Constants
DataLengthSize length of part of AcraStruct that store data part length.
Shows key and data length.
length of EC public key.
length of 32 byte of symmetric key wrapped to smessage.
Shows key and data length.
TagSymbol used in begin tag in AcraStruct.
# Variables
Errors show incorrect AcraStruct length.
Errors show incorrect AcraStruct length.
Errors show incorrect AcraStruct length.
ErrInvalidAcraStruct defines invalid AcraStruct error.
ErrNoPrivateKeys is returned when DecryptRotatedAcrastruct is given an empty key list.
TagBegin represents begin sequence of bytes for AcraStruct.
# Interfaces
Processor interface used as callback for recognized AcraStructs and should return data instead AcraStruct.