package common
import "github.com/jcmturner/gokrb5/v8/crypto/common"
Package common provides encryption methods common across encryption types
Index ¶
- func GetChecksumHash(b, key []byte, usage uint32, etype etype.EType) ([]byte, error)
- func GetHash(pt, key []byte, usage []byte, etype etype.EType) ([]byte, error)
- func GetIntegrityHash(b, key []byte, usage uint32, etype etype.EType) ([]byte, error)
- func GetUsageKc(un uint32) []byte
- func GetUsageKe(un uint32) []byte
- func GetUsageKi(un uint32) []byte
- func IterationsToS2Kparams(i uint32) string
- func PKCS7Pad(b []byte, m int) ([]byte, error)
- func PKCS7Unpad(b []byte, m int) ([]byte, error)
- func VerifyChecksum(key, chksum, msg []byte, usage uint32, etype etype.EType) bool
- func ZeroPad(b []byte, m int) ([]byte, error)
Functions ¶
func GetChecksumHash ¶
GetChecksumHash returns a keyed checksum hash of the bytes provided.
func GetHash ¶
GetHash generates the keyed hash value according to the etype's hash function.
func GetIntegrityHash ¶
GetIntegrityHash returns a keyed integrity hash of the bytes provided.
func GetUsageKc ¶
GetUsageKc returns the checksum key usage value for the usage number un.
See RFC 3961 5.3 key-derivation function definition.
func GetUsageKe ¶
GetUsageKe returns the encryption key usage value for the usage number un
See RFC 3961 5.3 key-derivation function definition.
func GetUsageKi ¶
GetUsageKi returns the integrity key usage value for the usage number un
See RFC 3961 5.3 key-derivation function definition.
func IterationsToS2Kparams ¶
IterationsToS2Kparams converts the number of iterations as an integer to a string representation.
func PKCS7Pad ¶
PKCS7Pad pads bytes according to RFC 2315 to nearest multiple of message size m.
func PKCS7Unpad ¶
PKCS7Unpad removes RFC 2315 padding from byes where message size is m.
func VerifyChecksum ¶
VerifyChecksum compares the checksum of the msg bytes is the same as the checksum provided.
func ZeroPad ¶
ZeroPad pads bytes with zeros to nearest multiple of message size m.
Source Files ¶
- Version
- v8.4.2
- Published
- Nov 18, 2020
- Platform
- js/wasm
- Imports
- 7 packages
- Last checked
- 4 hours ago –
Tools for package owners.