package messages

Import Path
	github.com/jcmturner/gokrb5/v8/messages (on go.dev)

Dependency Relation
	imports 24 packages, and imported by 4 packages

Involved Source Files APRep.go APReq.go KDCRep.go KDCReq.go KRBCred.go Package messages implements Kerberos 5 message types and methods. KRBPriv.go KRBSafe.go Ticket.go
Package-Level Type Names (total 23)
/* sort by: | */
APRep implements RFC 4120 KRB_AP_REP: https://tools.ietf.org/html/rfc4120#section-5.5.2. EncPart types.EncryptedData MsgType int PVNO int Unmarshal bytes b into the APRep struct.
APReq implements RFC 4120 KRB_AP_REQ: https://tools.ietf.org/html/rfc4120#section-5.5.1. APOptions asn1.BitString Authenticator types.Authenticator EncryptedAuthenticator types.EncryptedData MsgType int PVNO int Ticket Ticket DecryptAuthenticator decrypts the Authenticator within the AP_REQ. sessionKey may simply be the key within the decrypted EncPart of the ticket within the AP_REQ. Marshal APReq struct. Unmarshal bytes b into the APReq struct. Verify an AP_REQ using service's keytab, spn and max acceptable clock skew duration. The service ticket encrypted part and authenticator will be decrypted as part of this operation. func NewAPReq(tkt Ticket, sessionKey types.EncryptionKey, auth types.Authenticator) (APReq, error) func github.com/jcmturner/gokrb5/v8/service.VerifyAPREQ(APReq *APReq, s *service.Settings) (bool, *credentials.Credentials, error)
ASRep implements RFC 4120 KRB_AS_REP: https://tools.ietf.org/html/rfc4120#section-5.4.2. KDCRepFields KDCRepFields KDCRepFields.CName types.PrincipalName KDCRepFields.CRealm string KDCRepFields.DecryptedEncPart EncKDCRepPart KDCRepFields.EncPart types.EncryptedData KDCRepFields.MsgType int KDCRepFields.PAData []types.PAData KDCRepFields.PVNO int KDCRepFields.Ticket Ticket DecryptEncPart decrypts the encrypted part of an AS_REP. Marshal ASRep struct. Unmarshal bytes b into the ASRep struct. Verify checks the validity of AS_REP message. func github.com/jcmturner/gokrb5/v8/client.(*Client).ASExchange(realm string, ASReq ASReq, referral int) (ASRep, error)
ASReq implements RFC 4120 KRB_AS_REQ: https://tools.ietf.org/html/rfc4120#section-5.4.1. KDCReqFields KDCReqFields KDCReqFields.MsgType int KDCReqFields.PAData types.PADataSequence KDCReqFields.PVNO int KDCReqFields.Renewal bool KDCReqFields.ReqBody KDCReqBody Marshal ASReq struct. Unmarshal bytes b into the ASReq struct. func NewASReq(realm string, c *config.Config, cname, sname types.PrincipalName) (ASReq, error) func NewASReqForChgPasswd(realm string, c *config.Config, cname types.PrincipalName) (ASReq, error) func NewASReqForTGT(realm string, c *config.Config, cname types.PrincipalName) (ASReq, error) func (*ASRep).Verify(cfg *config.Config, creds *credentials.Credentials, asReq ASReq) (bool, error) func github.com/jcmturner/gokrb5/v8/client.(*Client).ASExchange(realm string, ASReq ASReq, referral int) (ASRep, error)
EncAPRepPart is the encrypted part of KRB_AP_REP. CTime time.Time Cusec int SequenceNumber int64 Subkey types.EncryptionKey Unmarshal bytes b into the APRep encrypted part struct.
EncKDCRepPart is the encrypted part of KRB_KDC_REP. AuthTime time.Time CAddr []types.HostAddress EncPAData types.PADataSequence EndTime time.Time Flags asn1.BitString Key types.EncryptionKey KeyExpiration time.Time LastReqs []LastReq Nonce int RenewTill time.Time SName types.PrincipalName SRealm string StartTime time.Time Marshal encrypted part of KRB_KDC_REP. Unmarshal bytes b into encrypted part of KRB_KDC_REP.
EncKrbCredPart is the encrypted part of KRB_CRED. Nouce int RAddress types.HostAddress SAddress types.HostAddress TicketInfo []KrbCredInfo Timestamp time.Time Usec int Unmarshal bytes b into the encrypted part of KRB_CRED.
EncKrbPrivPart is the encrypted part of KRB_PRIV. RAddress types.HostAddress SAddress types.HostAddress SequenceNumber int64 Timestamp time.Time Usec int UserData []byte Unmarshal bytes b into the EncKrbPrivPart struct. func NewKRBPriv(part EncKrbPrivPart) KRBPriv
EncTicketPart is the encrypted part of the Ticket. AuthTime time.Time AuthorizationData types.AuthorizationData CAddr types.HostAddresses CName types.PrincipalName CRealm string EndTime time.Time Flags asn1.BitString Key types.EncryptionKey RenewTill time.Time StartTime time.Time Transited TransitedEncoding Unmarshal bytes b into the EncTicketPart struct.
KDCRepFields represents the KRB_KDC_REP fields. CName types.PrincipalName CRealm string DecryptedEncPart EncKDCRepPart EncPart types.EncryptedData MsgType int PAData []types.PAData PVNO int Ticket Ticket
KDCReqBody implements the KRB_KDC_REQ request body. AdditionalTickets []Ticket Addresses []types.HostAddress CName types.PrincipalName EType []int32 EncAuthData types.EncryptedData From time.Time KDCOptions asn1.BitString Nonce int RTime time.Time Realm string SName types.PrincipalName Till time.Time Marshal KRB_KDC_REQ body struct. Unmarshal bytes b into the KRB_KDC_REQ body struct.
KDCReqFields represents the KRB_KDC_REQ fields. MsgType int PAData types.PADataSequence PVNO int Renewal bool ReqBody KDCReqBody
KRBCred implements RFC 4120 KRB_CRED: https://tools.ietf.org/html/rfc4120#section-5.8.1. DecryptedEncPart EncKrbCredPart EncPart types.EncryptedData MsgType int PVNO int Tickets []Ticket DecryptEncPart decrypts the encrypted part of a KRB_CRED. Unmarshal bytes b into the KRBCred struct.
KRBError implements RFC 4120 KRB_ERROR: https://tools.ietf.org/html/rfc4120#section-5.9.1. CName types.PrincipalName CRealm string CTime time.Time Cusec int EData []byte EText string ErrorCode int32 MsgType int PVNO int Realm string SName types.PrincipalName STime time.Time Susec int Error method implementing error interface on KRBError struct. Marshal a KRBError into bytes. Unmarshal bytes b into the KRBError struct. KRBError : error func NewKRBError(sname types.PrincipalName, realm string, code int32, etext string) KRBError func github.com/jcmturner/gokrb5/v8/client.(*Client).Key(etype etype.EType, kvno int, krberr *KRBError) (types.EncryptionKey, int, error)
KRBPriv implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.7.1. // Not part of ASN1 bytes so marked as optional so unmarshalling works EncPart types.EncryptedData MsgType int PVNO int DecryptEncPart decrypts the encrypted part of the KRBPriv message. EncryptEncPart encrypts the DecryptedEncPart within the KRBPriv. Use to prepare for marshaling. Marshal the KRBPriv. Unmarshal bytes b into the KRBPriv struct. func NewKRBPriv(part EncKrbPrivPart) KRBPriv
KRBSafe implements RFC 4120 KRB_SAFE: https://tools.ietf.org/html/rfc4120#section-5.6.1. Cksum types.Checksum MsgType int PVNO int SafeBody KRBSafeBody Unmarshal bytes b into the KRBSafe struct.
KRBSafeBody implements the KRB_SAFE_BODY of KRB_SAFE. RAddress types.HostAddress SAddress types.HostAddress SequenceNumber int64 Timestamp time.Time Usec int UserData []byte
LastReq part of KRB_KDC_REP. LRType int32 LRValue time.Time
TGSRep implements RFC 4120 KRB_TGS_REP: https://tools.ietf.org/html/rfc4120#section-5.4.2. KDCRepFields KDCRepFields KDCRepFields.CName types.PrincipalName KDCRepFields.CRealm string KDCRepFields.DecryptedEncPart EncKDCRepPart KDCRepFields.EncPart types.EncryptedData KDCRepFields.MsgType int KDCRepFields.PAData []types.PAData KDCRepFields.PVNO int KDCRepFields.Ticket Ticket DecryptEncPart decrypts the encrypted part of an TGS_REP. Marshal TGSRep struct. Unmarshal bytes b into the TGSRep struct. Verify checks the validity of the TGS_REP message. func github.com/jcmturner/gokrb5/v8/client.(*Client).TGSExchange(tgsReq TGSReq, kdcRealm string, tgt Ticket, sessionKey types.EncryptionKey, referral int) (TGSReq, TGSRep, error) func github.com/jcmturner/gokrb5/v8/client.(*Client).TGSREQGenerateAndExchange(spn types.PrincipalName, kdcRealm string, tgt Ticket, sessionKey types.EncryptionKey, renewal bool) (tgsReq TGSReq, tgsRep TGSRep, err error)
TGSReq implements RFC 4120 KRB_TGS_REQ: https://tools.ietf.org/html/rfc4120#section-5.4.1. KDCReqFields KDCReqFields KDCReqFields.MsgType int KDCReqFields.PAData types.PADataSequence KDCReqFields.PVNO int KDCReqFields.Renewal bool KDCReqFields.ReqBody KDCReqBody Marshal TGSReq struct. Unmarshal bytes b into the TGSReq struct. func NewTGSReq(cname types.PrincipalName, kdcRealm string, c *config.Config, tgt Ticket, sessionKey types.EncryptionKey, sname types.PrincipalName, renewal bool) (TGSReq, error) func NewUser2UserTGSReq(cname types.PrincipalName, kdcRealm string, c *config.Config, clientTGT Ticket, sessionKey types.EncryptionKey, sname types.PrincipalName, renewal bool, verifyingTGT Ticket) (TGSReq, error) func github.com/jcmturner/gokrb5/v8/client.(*Client).TGSExchange(tgsReq TGSReq, kdcRealm string, tgt Ticket, sessionKey types.EncryptionKey, referral int) (TGSReq, TGSRep, error) func github.com/jcmturner/gokrb5/v8/client.(*Client).TGSREQGenerateAndExchange(spn types.PrincipalName, kdcRealm string, tgt Ticket, sessionKey types.EncryptionKey, renewal bool) (tgsReq TGSReq, tgsRep TGSRep, err error) func (*TGSRep).Verify(cfg *config.Config, tgsReq TGSReq) (bool, error) func github.com/jcmturner/gokrb5/v8/client.(*Client).TGSExchange(tgsReq TGSReq, kdcRealm string, tgt Ticket, sessionKey types.EncryptionKey, referral int) (TGSReq, TGSRep, error)
Ticket implements the Kerberos ticket. // Not part of ASN1 bytes so marked as optional so unmarshalling works EncPart types.EncryptedData Realm string SName types.PrincipalName TktVNO int Decrypt decrypts the encrypted part of the ticket using the key provided. DecryptEncPart decrypts the encrypted part of the ticket. The sname argument can be used to specify which service principal's key should be used to decrypt the ticket. If nil is passed as the sname then the service principal specified within the ticket it used. GetPACType returns a Microsoft PAC that has been extracted from the ticket and processed. Marshal the Ticket. Unmarshal bytes b into a Ticket struct. Valid checks it the ticket is currently valid. Max duration passed endtime passed in as argument. func NewTicket(cname types.PrincipalName, crealm string, sname types.PrincipalName, srealm string, flags asn1.BitString, sktab *keytab.Keytab, eTypeID int32, kvno int, authTime, startTime, endTime, renewTill time.Time) (Ticket, types.EncryptionKey, error) func github.com/jcmturner/gokrb5/v8/client.(*Client).GetCachedTicket(spn string) (Ticket, types.EncryptionKey, bool) func github.com/jcmturner/gokrb5/v8/client.(*Client).GetServiceTicket(spn string) (Ticket, types.EncryptionKey, error) func MarshalTicketSequence(tkts []Ticket) (asn1.RawValue, error) func NewAPReq(tkt Ticket, sessionKey types.EncryptionKey, auth types.Authenticator) (APReq, error) func NewTGSReq(cname types.PrincipalName, kdcRealm string, c *config.Config, tgt Ticket, sessionKey types.EncryptionKey, sname types.PrincipalName, renewal bool) (TGSReq, error) func NewUser2UserTGSReq(cname types.PrincipalName, kdcRealm string, c *config.Config, clientTGT Ticket, sessionKey types.EncryptionKey, sname types.PrincipalName, renewal bool, verifyingTGT Ticket) (TGSReq, error) func NewUser2UserTGSReq(cname types.PrincipalName, kdcRealm string, c *config.Config, clientTGT Ticket, sessionKey types.EncryptionKey, sname types.PrincipalName, renewal bool, verifyingTGT Ticket) (TGSReq, error) func github.com/jcmturner/gokrb5/v8/client.(*Client).TGSExchange(tgsReq TGSReq, kdcRealm string, tgt Ticket, sessionKey types.EncryptionKey, referral int) (TGSReq, TGSRep, error) func github.com/jcmturner/gokrb5/v8/client.(*Client).TGSREQGenerateAndExchange(spn types.PrincipalName, kdcRealm string, tgt Ticket, sessionKey types.EncryptionKey, renewal bool) (tgsReq TGSReq, tgsRep TGSRep, err error) func github.com/jcmturner/gokrb5/v8/kadmin.ChangePasswdMsg(cname types.PrincipalName, realm, password string, tkt Ticket, sessionKey types.EncryptionKey) (r kadmin.Request, k types.EncryptionKey, err error) func github.com/jcmturner/gokrb5/v8/spnego.NewKRB5TokenAPREQ(cl *client.Client, tkt Ticket, sessionKey types.EncryptionKey, GSSAPIFlags []int, APOptions []int) (spnego.KRB5Token, error) func github.com/jcmturner/gokrb5/v8/spnego.NewNegTokenInitKRB5(cl *client.Client, tkt Ticket, sessionKey types.EncryptionKey) (spnego.NegTokenInit, error)
TransitedEncoding part of the ticket's encrypted part. Contents []byte TRType int32
Package-Level Functions (total 10)
MarshalTicketSequence marshals a slice of Tickets returning an ASN1 raw value containing the ticket sequence.
NewAPReq generates a new KRB_AP_REQ struct.
NewASReq generates a new KRB_AS_REQ struct for a given SNAME.
NewASReqForChgPasswd generates a new KRB_AS_REQ struct for a change password request.
NewASReqForTGT generates a new KRB_AS_REQ struct for a TGT request.
NewKRBError creates a new KRBError.
NewKRBPriv returns a new KRBPriv type.
NewTGSReq generates a new KRB_TGS_REQ struct.
NewTicket creates a new Ticket instance.
NewUser2UserTGSReq returns a TGS-REQ suitable for user-to-user authentication (https://tools.ietf.org/html/rfc4120#section-3.7)