Documentation ¶
Overview ¶
Package keytab implements Kerberos keytabs: https://web.mit.edu/kerberos/krb5-devel/doc/formats/keytab_file_format.html.
Index ¶
- type Entry
- type Keytab
- type KeytabImpl
- func (kt *KeytabImpl) AddEntry(principalName, realm, password string, ts time.Time, KVNO uint8, encType int32) error
- func (kt *KeytabImpl) Entries() []Entry
- func (kt *KeytabImpl) GetEncryptionKey(princName types.PrincipalName, realm string, kvno int, etype int32) (types.EncryptionKey, int, error)
- func (kt *KeytabImpl) JSON() (string, error)
- func (kt *KeytabImpl) Marshal() ([]byte, error)
- func (k KeytabImpl) String() string
- func (kt *KeytabImpl) Unmarshal(b []byte) error
- func (kt *KeytabImpl) Write(w io.Writer) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct { Principal principal Timestamp time.Time KVNO8 uint8 Key types.EncryptionKey KVNO uint32 }
Keytab Entry struct.
type Keytab ¶
type Keytab interface { GetEncryptionKey(princName types.PrincipalName, realm string, kvno int, etype int32) (types.EncryptionKey, int, error) Marshal() ([]byte, error) Write(w io.Writer) (int, error) Unmarshal(b []byte) error AddEntry(principalName, realm, password string, ts time.Time, KVNO uint8, encType int32) error Entries() []Entry String() string JSON() (string, error) }
type KeytabImpl ¶
type KeytabImpl struct {
// contains filtered or unexported fields
}
KeytabImpl struct.
func (*KeytabImpl) AddEntry ¶
func (kt *KeytabImpl) AddEntry(principalName, realm, password string, ts time.Time, KVNO uint8, encType int32) error
AddEntry adds an entry to the keytab. The password should be provided in plain text and it will be converted using the defined enctype to be stored.
func (*KeytabImpl) Entries ¶
func (kt *KeytabImpl) Entries() []Entry
func (*KeytabImpl) GetEncryptionKey ¶
func (kt *KeytabImpl) GetEncryptionKey(princName types.PrincipalName, realm string, kvno int, etype int32) (types.EncryptionKey, int, error)
GetEncryptionKey returns the EncryptionKey from the Keytab for the newest entry with the required kvno, etype and matching principal. If the kvno is zero then the latest kvno will be returned. The kvno is also returned for
func (*KeytabImpl) JSON ¶
func (kt *KeytabImpl) JSON() (string, error)
JSON return information about the keys held in the keytab in a JSON format.
func (*KeytabImpl) Marshal ¶
func (kt *KeytabImpl) Marshal() ([]byte, error)
Marshal keytab into byte slice
func (KeytabImpl) String ¶
func (k KeytabImpl) String() string
func (*KeytabImpl) Unmarshal ¶
func (kt *KeytabImpl) Unmarshal(b []byte) error
Unmarshal byte slice of Keytab data into Keytab type.