package common

import "github.com/jcmturner/gokrb5/v8/crypto/common"

Package common provides encryption methods common across encryption types

Index

Functions

func GetChecksumHash

func GetChecksumHash(b, key []byte, usage uint32, etype etype.EType) ([]byte, error)

GetChecksumHash returns a keyed checksum hash of the bytes provided.

func GetHash

func GetHash(pt, key []byte, usage []byte, etype etype.EType) ([]byte, error)

GetHash generates the keyed hash value according to the etype's hash function.

func GetIntegrityHash

func GetIntegrityHash(b, key []byte, usage uint32, etype etype.EType) ([]byte, error)

GetIntegrityHash returns a keyed integrity hash of the bytes provided.

func GetUsageKc

func GetUsageKc(un uint32) []byte

GetUsageKc returns the checksum key usage value for the usage number un.

See RFC 3961 5.3 key-derivation function definition.

func GetUsageKe

func GetUsageKe(un uint32) []byte

GetUsageKe returns the encryption key usage value for the usage number un

See RFC 3961 5.3 key-derivation function definition.

func GetUsageKi

func GetUsageKi(un uint32) []byte

GetUsageKi returns the integrity key usage value for the usage number un

See RFC 3961 5.3 key-derivation function definition.

func IterationsToS2Kparams

func IterationsToS2Kparams(i uint32) string

IterationsToS2Kparams converts the number of iterations as an integer to a string representation.

func PKCS7Pad

func PKCS7Pad(b []byte, m int) ([]byte, error)

PKCS7Pad pads bytes according to RFC 2315 to nearest multiple of message size m.

func PKCS7Unpad

func PKCS7Unpad(b []byte, m int) ([]byte, error)

PKCS7Unpad removes RFC 2315 padding from byes where message size is m.

func VerifyChecksum

func VerifyChecksum(key, chksum, msg []byte, usage uint32, etype etype.EType) bool

VerifyChecksum compares the checksum of the msg bytes is the same as the checksum provided.

func ZeroPad

func ZeroPad(b []byte, m int) ([]byte, error)

ZeroPad pads bytes with zeros to nearest multiple of message size m.

Source Files

common.go

Version
v8.4.2
Published
Nov 18, 2020
Platform
js/wasm
Imports
7 packages
Last checked
4 hours ago

Tools for package owners.