rfc4757

package
v2.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package rfc4757 provides encryption and checksum methods as specified in RFC 4757

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Checksum

func Checksum(key []byte, usage uint32, data []byte) ([]byte, error)

Checksum returns a hash of the data in accordance with RFC 4757

func DecryptData

func DecryptData(key, data []byte, e etype.EType) ([]byte, error)

DecryptData decrypts the data provided using the methods specific to the etype provided as defined in RFC 4757.

func DecryptMessage

func DecryptMessage(key, data []byte, usage uint32, export bool, e etype.EType) ([]byte, error)

DecryptMessage decrypts the message provided using the methods specific to the etype provided as defined in RFC 4757. The integrity of the message is also verified.

func EncryptData

func EncryptData(key, data []byte, e etype.EType) ([]byte, error)

EncryptData encrypts the data provided using methods specific to the etype provided as defined in RFC 4757.

func EncryptMessage

func EncryptMessage(key, data []byte, usage uint32, export bool, e etype.EType) ([]byte, error)

EncryptMessage encrypts the message provided using the methods specific to the etype provided as defined in RFC 4757. The encrypted data is concatenated with its RC4 header containing integrity checksum and confounder to create an encrypted message.

func HMAC

func HMAC(key []byte, data []byte) []byte

HMAC returns a keyed MD5 checksum of the data

func StringToKey

func StringToKey(secret string) ([]byte, error)

StringToKey returns a key derived from the string provided according to the definition in RFC 4757.

func UsageToMSMsgType

func UsageToMSMsgType(usage uint32) []byte

UsageToMSMsgType converts Kerberos key usage numbers to Microsoft message type encoded as a little-endian four byte slice.

func VerifyIntegrity

func VerifyIntegrity(key, pt, data []byte, e etype.EType) bool

VerifyIntegrity checks the integrity checksum of the data matches that calculated from the decrypted data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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