rfc4757

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeySaltWrap = int32(13)
	KeySaltMIC  = int32(15)
)
View Source
const (
	// HMAC signature algorithm.
	SignAlgorithmHMAC = 0x1100
	// RC4 seal algorithm.
	SealAlgorithmRC4 = 0x1000
)

Variables

This section is empty.

Functions

func ComputeChecksum

func ComputeChecksum(key []byte, salt int32, data ...any) ([]byte, error)

func ComputeMICChecksum

func ComputeMICChecksum(key []byte, data ...any) ([]byte, error)

func ComputeWrapChecksum

func ComputeWrapChecksum(key []byte, data ...any) ([]byte, error)

func DeriveEncryptionKey

func DeriveEncryptionKey(key []byte, seqNum []byte) ([]byte, error)

func DeriveSigningKey

func DeriveSigningKey(key []byte) ([]byte, error)

func NewCipher

func NewCipher(key []byte, seqNum []byte) (*rc4.Cipher, error)

func XORSequenceNumber

func XORSequenceNumber(key []byte, cksum []byte, seqNum []byte) error

Types

type MICToken

type MICToken rfc1964.MICToken

MICToken is a token used for MIC.

func NewMICToken

func NewMICToken() *MICToken

NewMICToken creates a new MICToken.

func (*MICToken) Equals

func (tok *MICToken) Equals(other *MICToken) bool

Equals returns true if the two tokens are equal.

func (*MICToken) Header

func (tok *MICToken) Header() []byte

Header returns the header of the token.

func (*MICToken) Marshal

func (tok *MICToken) Marshal() []byte

Marshal returns the byte representation of the token.

func (*MICToken) SetSequenceNumber

func (tok *MICToken) SetSequenceNumber(seqNum uint32, isLocal bool) *MICToken

SetSequenceNumber sets the sequence number of the token.

func (*MICToken) Size

func (tok *MICToken) Size() int

Size returns the size of the token.

func (*MICToken) Unmarshal

func (tok *MICToken) Unmarshal(b []byte) error

Unmarshal parses the byte representation of the token.

type WrapToken

type WrapToken rfc1964.WrapToken

WrapToken is a token used for wrapping.

func NewWrapToken

func NewWrapToken() *WrapToken

NewWrapToken creates a new WrapToken.

func (*WrapToken) Equals

func (tok *WrapToken) Equals(other *WrapToken) bool

Equals returns true if the two tokens are equal.

func (*WrapToken) Header

func (tok *WrapToken) Header() []byte

Header returns the header of the token.

func (*WrapToken) Marshal

func (tok *WrapToken) Marshal() []byte

Marshal returns the byte representation of the token.

func (*WrapToken) SetEncryption

func (tok *WrapToken) SetEncryption(encrypt bool) *WrapToken

func (*WrapToken) SetSequenceNumber

func (tok *WrapToken) SetSequenceNumber(seqNum uint32, isLocal bool) *WrapToken

SetSequenceNumber sets the sequence number of the token.

func (*WrapToken) Size

func (tok *WrapToken) Size() int

Size returns the size of the token.

func (*WrapToken) Unmarshal

func (tok *WrapToken) Unmarshal(b []byte) error

Unmarshal parses the byte representation of the token.

func (*WrapToken) UseEncryption

func (tok *WrapToken) UseEncryption() bool

Jump to

Keyboard shortcuts

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