wrapper

package module
v0.0.0-...-9cb923c Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Success C.int = C.int(1)
	Failure C.int = C.int(0)
)

Functions

func ApplyHash

func ApplyHash(hashObject *CryptoHash, data *[]byte) error

вычислить хэш

func CalculateHashValue

func CalculateHashValue(hashObject *CryptoHash, size HSize) (*[]byte, error)

вычислить хэш

func ReleaseCSP

func ReleaseCSP(cryptoProvider *CryptoProvider)

освободить экземпляр криптопровайдера

func ReleaseHashMethod

func ReleaseHashMethod(hashMethod *CryptoHash)

освободить метод хэширования

Types

type CSPException

type CSPException struct {
	// contains filtered or unexported fields
}

Исключение работы с csp

func (*CSPException) Error

func (exception *CSPException) Error() string

type CSPType

type CSPType int64

Тип CSP

const (
	GOST2001     CSPType = C.PROV_GOST_2001_DH
	GOST2012_256 CSPType = C.PROV_GOST_2012_256
	GOST2012_512 CSPType = C.PROV_GOST_2012_512
)

type CalculateHashException

type CalculateHashException struct {
	// contains filtered or unexported fields
}

Исключение вычисления хэша

func (*CalculateHashException) Error

func (exception *CalculateHashException) Error() string

type CryptoHash

type CryptoHash C.HCRYPTHASH

Хэш

func TakeHashMethod

func TakeHashMethod(cryptoProvider *CryptoProvider, hashType HashType) (*CryptoHash, error)

получить метод хэширования

type CryptoProvider

type CryptoProvider C.HCRYPTPROV

Криптопровайдер

func TakeCSP

func TakeCSP(cspType CSPType) (*CryptoProvider, error)

получить экземпляр крипто провайдера

type GetHashException

type GetHashException struct {
	// contains filtered or unexported fields
}

исключение получения параметра хэша

func (*GetHashException) Error

func (exception *GetHashException) Error() string

type HSize

type HSize C.ulong

Размер хэша

var (
	Size256 HSize = 32
	Size512 HSize = 64
)

type HashMethodException

type HashMethodException struct {
	// contains filtered or unexported fields
}

Исключение получения метода хэширования

func (*HashMethodException) Error

func (exception *HashMethodException) Error() string

type HashType

type HashType uint

Тип хэша

const (
	GOST3411          HashType = C.CALG_GR3411
	GOST3411_2012_256 HashType = C.CALG_GR3411_2012_256
	GOST3411_2012_512 HashType = C.CALG_GR3411_2012_512
)

Jump to

Keyboard shortcuts

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