package keytab

import "github.com/jcmturner/gokrb5/v8/keytab"

Package keytab implements Kerberos keytabs: https://web.mit.edu/kerberos/krb5-devel/doc/formats/keytab_file_format.html.

Index

Types

type Keytab

type Keytab struct {
	Entries []entry
	// contains filtered or unexported fields
}

Keytab struct.

func Load

func Load(ktPath string) (*Keytab, error)

Load a Keytab file into a Keytab type.

func New

func New() *Keytab

New creates new, empty Keytab type.

func (*Keytab) AddEntry

func (k *Keytab) 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 (*Keytab) GetEncryptionKey

func (kt *Keytab) 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 (*Keytab) JSON

func (k *Keytab) JSON() (string, error)

JSON return information about the keys held in the keytab in a JSON format.

func (*Keytab) Marshal

func (kt *Keytab) Marshal() ([]byte, error)

Marshal keytab into byte slice

func (Keytab) String

func (k Keytab) String() string

func (*Keytab) Unmarshal

func (kt *Keytab) Unmarshal(b []byte) error

Unmarshal byte slice of Keytab data into Keytab type.

func (*Keytab) Write

func (kt *Keytab) Write(w io.Writer) (int, error)

Write the keytab bytes to io.Writer. Returns the number of bytes written

Source Files

keytab.go

Version
v8.4.0
Published
Jun 14, 2020
Platform
js/wasm
Imports
12 packages
Last checked
3 hours ago

Tools for package owners.