gokrb5.v7: gopkg.in/jcmturner/gokrb5.v7/types Index | Files

package types

import "gopkg.in/jcmturner/gokrb5.v7/types"

Package types provides Kerberos 5 data types.

Index

Package Files

Authenticator.go AuthorizationData.go Cryptosystem.go HostAddress.go KerberosFlags.go PAData.go PrincipalName.go TypedData.go

func GetPAEncTSEncAsnMarshalled Uses

func GetPAEncTSEncAsnMarshalled() ([]byte, error)

GetPAEncTSEncAsnMarshalled returns the bytes of a PAEncTSEnc.

func HostAddressesContains Uses

func HostAddressesContains(h []HostAddress, a HostAddress) bool

HostAddressesContains tests if a HostAddress is contained in a HostAddress slice.

func HostAddressesEqual Uses

func HostAddressesEqual(h, a []HostAddress) bool

HostAddressesEqual tests if two HostAddress slices are equal.

func IsFlagSet Uses

func IsFlagSet(f *asn1.BitString, i int) bool

IsFlagSet tests if a flag is set in the ASN1 BitString.

func NewKrbFlags Uses

func NewKrbFlags() asn1.BitString

NewKrbFlags returns an ASN1 BitString struct of the right size for KrbFlags.

func SetFlag Uses

func SetFlag(f *asn1.BitString, i int)

SetFlag sets a flag in an ASN1 BitString.

func SetFlags Uses

func SetFlags(f *asn1.BitString, j []int)

SetFlags sets the flags of an ASN1 BitString.

func UnsetFlag Uses

func UnsetFlag(f *asn1.BitString, i int)

UnsetFlag unsets a flag in an ASN1 BitString.

func UnsetFlags Uses

func UnsetFlags(f *asn1.BitString, j []int)

UnsetFlags unsets flags in an ASN1 BitString.

type ADAndOr Uses

type ADAndOr struct {
    ConditionCount int32             `asn1:"explicit,tag:0"`
    Elements       AuthorizationData `asn1:"explicit,tag:1"`
}

ADAndOr implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6.3

type ADIfRelevant Uses

type ADIfRelevant AuthorizationData

ADIfRelevant implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6.1

type ADKDCIssued Uses

type ADKDCIssued struct {
    ADChecksum Checksum          `asn1:"explicit,tag:0"`
    IRealm     string            `asn1:"optional,generalstring,explicit,tag:1"`
    Isname     PrincipalName     `asn1:"optional,explicit,tag:2"`
    Elements   AuthorizationData `asn1:"explicit,tag:3"`
}

ADKDCIssued implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6.2

func (*ADKDCIssued) Unmarshal Uses

func (a *ADKDCIssued) Unmarshal(b []byte) error

Unmarshal bytes into the ADKDCIssued.

type ADMandatoryForKDC Uses

type ADMandatoryForKDC AuthorizationData

ADMandatoryForKDC implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6.4

type Authenticator Uses

type Authenticator struct {
    AVNO              int               `asn1:"explicit,tag:0"`
    CRealm            string            `asn1:"generalstring,explicit,tag:1"`
    CName             PrincipalName     `asn1:"explicit,tag:2"`
    Cksum             Checksum          `asn1:"explicit,optional,tag:3"`
    Cusec             int               `asn1:"explicit,tag:4"`
    CTime             time.Time         `asn1:"generalized,explicit,tag:5"`
    SubKey            EncryptionKey     `asn1:"explicit,optional,tag:6"`
    SeqNumber         int64             `asn1:"explicit,optional,tag:7"`
    AuthorizationData AuthorizationData `asn1:"explicit,optional,tag:8"`
}

Authenticator - A record containing information that can be shown to have been recently generated using the session key known only by the client and server. https://tools.ietf.org/html/rfc4120#section-5.5.1

func NewAuthenticator Uses

func NewAuthenticator(realm string, cname PrincipalName) (Authenticator, error)

NewAuthenticator creates a new Authenticator.

func (*Authenticator) GenerateSeqNumberAndSubKey Uses

func (a *Authenticator) GenerateSeqNumberAndSubKey(keyType int32, keySize int) error

GenerateSeqNumberAndSubKey sets the Authenticator's sequence number and subkey.

func (*Authenticator) Marshal Uses

func (a *Authenticator) Marshal() ([]byte, error)

Marshal the Authenticator.

func (*Authenticator) Unmarshal Uses

func (a *Authenticator) Unmarshal(b []byte) error

Unmarshal bytes into the Authenticator.

type AuthorizationData Uses

type AuthorizationData []AuthorizationDataEntry

AuthorizationData implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6

func (*AuthorizationData) Unmarshal Uses

func (a *AuthorizationData) Unmarshal(b []byte) error

Unmarshal bytes into the AuthorizationData.

type AuthorizationDataEntry Uses

type AuthorizationDataEntry struct {
    ADType int32  `asn1:"explicit,tag:0"`
    ADData []byte `asn1:"explicit,tag:1"`
}

AuthorizationDataEntry implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6

func (*AuthorizationDataEntry) Unmarshal Uses

func (a *AuthorizationDataEntry) Unmarshal(b []byte) error

Unmarshal bytes into the AuthorizationDataEntry.

type Checksum Uses

type Checksum struct {
    CksumType int32  `asn1:"explicit,tag:0"`
    Checksum  []byte `asn1:"explicit,tag:1"`
}

Checksum implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.9

func (*Checksum) Unmarshal Uses

func (a *Checksum) Unmarshal(b []byte) error

Unmarshal bytes into the Checksum.

type ETypeInfo Uses

type ETypeInfo []ETypeInfoEntry

ETypeInfo implements RFC 4120 types: https://tools.ietf.org/html/rfc4120#section-5.2.7.4

func (*ETypeInfo) Unmarshal Uses

func (a *ETypeInfo) Unmarshal(b []byte) error

Unmarshal bytes into the ETypeInfo

type ETypeInfo2 Uses

type ETypeInfo2 []ETypeInfo2Entry

ETypeInfo2 implements RFC 4120 types: https://tools.ietf.org/html/rfc4120#section-5.2.7.5

func (*ETypeInfo2) Unmarshal Uses

func (a *ETypeInfo2) Unmarshal(b []byte) error

Unmarshal bytes into the ETypeInfo2

type ETypeInfo2Entry Uses

type ETypeInfo2Entry struct {
    EType     int32  `asn1:"explicit,tag:0"`
    Salt      string `asn1:"explicit,optional,generalstring,tag:1"`
    S2KParams []byte `asn1:"explicit,optional,tag:2"`
}

ETypeInfo2Entry implements RFC 4120 types: https://tools.ietf.org/html/rfc4120#section-5.2.7.5

func (*ETypeInfo2Entry) Unmarshal Uses

func (a *ETypeInfo2Entry) Unmarshal(b []byte) error

Unmarshal bytes into the ETypeInfo2Entry

type ETypeInfoEntry Uses

type ETypeInfoEntry struct {
    EType int32  `asn1:"explicit,tag:0"`
    Salt  []byte `asn1:"explicit,optional,tag:1"`
}

ETypeInfoEntry implements RFC 4120 types: https://tools.ietf.org/html/rfc4120#section-5.2.7.4

func (*ETypeInfoEntry) Unmarshal Uses

func (a *ETypeInfoEntry) Unmarshal(b []byte) error

Unmarshal bytes into the ETypeInfoEntry

type EncryptedData Uses

type EncryptedData struct {
    EType  int32  `asn1:"explicit,tag:0"`
    KVNO   int    `asn1:"explicit,optional,tag:1"`
    Cipher []byte `asn1:"explicit,tag:2"`
}

EncryptedData implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.9

func (*EncryptedData) Marshal Uses

func (a *EncryptedData) Marshal() ([]byte, error)

Marshal the EncryptedData.

func (*EncryptedData) Unmarshal Uses

func (a *EncryptedData) Unmarshal(b []byte) error

Unmarshal bytes into the EncryptedData.

type EncryptionKey Uses

type EncryptionKey struct {
    KeyType  int32  `asn1:"explicit,tag:0"`
    KeyValue []byte `asn1:"explicit,tag:1"`
}

EncryptionKey implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.9 AKA KeyBlock

func (*EncryptionKey) Unmarshal Uses

func (a *EncryptionKey) Unmarshal(b []byte) error

Unmarshal bytes into the EncryptionKey.

type HostAddress Uses

type HostAddress struct {
    AddrType int32  `asn1:"explicit,tag:0"`
    Address  []byte `asn1:"explicit,tag:1"`
}

HostAddress implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.5

func GetHostAddress Uses

func GetHostAddress(s string) (HostAddress, error)

GetHostAddress returns a HostAddress struct from a string in the format <hostname>:<port>

func HostAddressFromNetIP Uses

func HostAddressFromNetIP(ip net.IP) HostAddress

HostAddressFromNetIP returns a HostAddress type from a net.IP

func (*HostAddress) Equal Uses

func (h *HostAddress) Equal(a HostAddress) bool

Equal tests if the HostAddress is equal to another HostAddress provided.

func (*HostAddress) GetAddress Uses

func (h *HostAddress) GetAddress() (string, error)

GetAddress returns a string representation of the HostAddress.

type HostAddresses Uses

type HostAddresses []HostAddress

HostAddresses implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.5

func HostAddressesFromNetIPs Uses

func HostAddressesFromNetIPs(ips []net.IP) (ha HostAddresses)

HostAddressesFromNetIPs returns a HostAddresses type from a slice of net.IP

func LocalHostAddresses Uses

func LocalHostAddresses() (ha HostAddresses, err error)

LocalHostAddresses returns a HostAddresses struct for the local machines interface IP addresses.

func (*HostAddresses) Contains Uses

func (h *HostAddresses) Contains(a HostAddress) bool

Contains tests if a HostAddress is contained within the HostAddresses struct.

func (*HostAddresses) Equal Uses

func (h *HostAddresses) Equal(a []HostAddress) bool

Equal tests if a HostAddress slice is equal to the HostAddresses struct.

type MethodData Uses

type MethodData []PAData

MethodData implements RFC 4120 types: https://tools.ietf.org/html/rfc4120#section-5.9.1

type PAData Uses

type PAData struct {
    PADataType  int32  `asn1:"explicit,tag:1"`
    PADataValue []byte `asn1:"explicit,tag:2"`
}

PAData implements RFC 4120 types: https://tools.ietf.org/html/rfc4120#section-5.2.7

func (*PAData) GetETypeInfo Uses

func (pa *PAData) GetETypeInfo() (d ETypeInfo, err error)

GetETypeInfo returns an ETypeInfo from the PAData.

func (*PAData) GetETypeInfo2 Uses

func (pa *PAData) GetETypeInfo2() (d ETypeInfo2, err error)

GetETypeInfo2 returns an ETypeInfo2 from the PAData.

func (*PAData) Unmarshal Uses

func (pa *PAData) Unmarshal(b []byte) error

Unmarshal bytes into the PAData

type PADataSequence Uses

type PADataSequence []PAData

PADataSequence implements RFC 4120 types: https://tools.ietf.org/html/rfc4120#section-5.2.7

func (*PADataSequence) Contains Uses

func (pas *PADataSequence) Contains(patype int32) bool

Contains tests if a PADataSequence contains PA Data of a certain type.

func (*PADataSequence) Unmarshal Uses

func (pas *PADataSequence) Unmarshal(b []byte) error

Unmarshal bytes into the PADataSequence

type PAEncTSEnc Uses

type PAEncTSEnc struct {
    PATimestamp time.Time `asn1:"generalized,explicit,tag:0"`
    PAUSec      int       `asn1:"explicit,optional,tag:1"`
}

PAEncTSEnc implements RFC 4120 types: https://tools.ietf.org/html/rfc4120#section-5.2.7.2

func (*PAEncTSEnc) Unmarshal Uses

func (pa *PAEncTSEnc) Unmarshal(b []byte) error

Unmarshal bytes into the PAEncTSEnc

type PAEncTimestamp Uses

type PAEncTimestamp EncryptedData

PAEncTimestamp implements RFC 4120 types: https://tools.ietf.org/html/rfc4120#section-5.2.7.2

func (*PAEncTimestamp) Unmarshal Uses

func (pa *PAEncTimestamp) Unmarshal(b []byte) error

Unmarshal bytes into the PAEncTimestamp

type PAReqEncPARep Uses

type PAReqEncPARep struct {
    ChksumType int32  `asn1:"explicit,tag:0"`
    Chksum     []byte `asn1:"explicit,tag:1"`
}

PAReqEncPARep PA Data Type

func (*PAReqEncPARep) Unmarshal Uses

func (pa *PAReqEncPARep) Unmarshal(b []byte) error

Unmarshal bytes into the PAReqEncPARep

type PrincipalName Uses

type PrincipalName struct {
    NameType   int32    `asn1:"explicit,tag:0"`
    NameString []string `asn1:"generalstring,explicit,tag:1"`
}

PrincipalName implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.2

func NewPrincipalName Uses

func NewPrincipalName(ntype int32, spn string) PrincipalName

NewPrincipalName creates a new PrincipalName from the name type int32 and name string provided.

func ParseSPNString Uses

func ParseSPNString(spn string) (pn PrincipalName, realm string)

ParseSPNString will parse a string in the format <service>/<name>@<realm> a PrincipalName type will be returned with the name type set to KRB_NT_PRINCIPAL(1) and the realm will be returned as a string. If the "@<realm>" suffix is not included in the SPN then the value of realm string returned will be ""

func (PrincipalName) Equal Uses

func (pn PrincipalName) Equal(n PrincipalName) bool

Equal tests if the PrincipalName is equal to the one provided.

func (PrincipalName) GetSalt Uses

func (pn PrincipalName) GetSalt(realm string) string

GetSalt returns a salt derived from the PrincipalName.

func (PrincipalName) PrincipalNameString Uses

func (pn PrincipalName) PrincipalNameString() string

PrincipalNameString returns the PrincipalName in string form.

type TypedData Uses

type TypedData struct {
    DataType  int32  `asn1:"explicit,tag:0"`
    DataValue []byte `asn1:"optional,explicit,tag:1"`
}

TypedData implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.9.1

type TypedDataSequence Uses

type TypedDataSequence []TypedData

TypedDataSequence implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.9.1

func (*TypedDataSequence) Unmarshal Uses

func (a *TypedDataSequence) Unmarshal(b []byte) error

Unmarshal bytes into the TypedDataSequence.

Package types imports 15 packages (graph) and is imported by 26 packages. Updated 2019-06-23. Refresh now. Tools for package owners.