Next: AS/TGS Functions, Previous: TGS Functions, Up: Programming Manual
See Ticket Functions, for an high-level overview of tickets. The following illustrates the Ticket and EncTicketPart ASN.1 structures.
Ticket ::= [APPLICATION 1] SEQUENCE { tkt-vno [0] INTEGER (5), realm [1] Realm, sname [2] PrincipalName, enc-part [3] EncryptedData -- EncTicketPart } -- Encrypted part of ticket EncTicketPart ::= [APPLICATION 3] SEQUENCE { flags [0] TicketFlags, key [1] EncryptionKey, crealm [2] Realm, cname [3] PrincipalName, transited [4] TransitedEncoding, authtime [5] KerberosTime, starttime [6] KerberosTime OPTIONAL, endtime [7] KerberosTime, renew-till [8] KerberosTime OPTIONAL, caddr [9] HostAddresses OPTIONAL, authorization-data [10] AuthorizationData OPTIONAL }
handle: shishi handle as allocated by
shishi_init()
.This function creates a new ASN.1 Ticket, populated with some default values.
Return value: Returns the ticket or NULL on failure.
handle: shishi handle as allocated by
shishi_init()
.ticket: input variable with ticket info.
realm: output array with newly allocated name of realm in ticket.
realmlen: size of output array.
Extract realm from ticket.
Return value: Returns SHISHI_OK iff successful.
handle: shishi handle as allocated by
shishi_init()
.ticket: input variable with ticket info.
realm: input array with name of realm.
Set the realm field in the Ticket.
Return value: Returns SHISHI_OK iff successful.
handle: Shishi library handle create by
shishi_init()
.ticket: ASN.1 Ticket variable to get server name from.
server: pointer to newly allocated zero terminated string containing principal name. May be
NULL
(to only populateserverlen
).serverlen: pointer to length of
server
on output, excluding terminating zero. May beNULL
(to only populateserver
).Represent server principal name in Ticket as zero-terminated string. The string is allocate by this function, and it is the responsibility of the caller to deallocate it. Note that the output length
serverlen
does not include the terminating zero.Return value: Returns SHISHI_OK iff successful.
handle: shishi handle as allocated by
shishi_init()
.ticket: Ticket variable to set server name field in.
name_type: type of principial, see Shishi_name_type, usually SHISHI_NT_UNKNOWN.
sname: input array with principal name.
Set the server name field in the Ticket.
Return value: Returns SHISHI_OK iff successful.
handle: shishi handle as allocated by
shishi_init()
.ticket: Ticket variable to get value from.
etype: output variable that holds the value.
Extract Ticket.enc-part.etype.
Return value: Returns SHISHI_OK iff successful.
handle: shishi handle as allocated by
shishi_init()
.ticket: Ticket to add enc-part field to.
etype: encryption type used to encrypt enc-part.
kvno: key version number.
buf: input array with encrypted enc-part.
buflen: size of input array with encrypted enc-part.
Set the encrypted enc-part field in the Ticket. The encrypted data is usually created by calling
shishi_encrypt()
on the DER encoded enc-part. To save time, you may want to useshishi_ticket_add_enc_part()
instead, which calculates the encrypted data and calls this function in one step.Return value: Returns SHISHI_OK iff successful.
handle: shishi handle as allocated by
shishi_init()
.ticket: Ticket to add enc-part field to.
key: key used to encrypt enc-part.
encticketpart: EncTicketPart to add.
Encrypts DER encoded EncTicketPart using key and stores it in the Ticket.
Return value: Returns SHISHI_OK iff successful.
handle: shishi handle as allocated by
shishi_init()
.encticketpart: input EncTicketPart variable.
key: newly allocated key.
Extract the session key in the Ticket.
Return value: Returns SHISHI_OK iff succesful.
handle: shishi handle as allocated by
shishi_init()
.encticketpart: input EncTicketPart variable.
key: key handle with information to store in encticketpart.
Set the EncTicketPart.key field to key type and value of supplied key.
Return value: Returns SHISHI_OK iff succesful.
handle: shishi handle as allocated by
shishi_init()
.encticketpart: input EncTicketPart variable.
flags: flags to set in encticketpart.
Set the EncTicketPart.flags to supplied value.
Return value: Returns SHISHI_OK iff succesful.
handle: shishi handle as allocated by
shishi_init()
.encticketpart: input EncTicketPart variable.
realm: input array with name of realm.
Set the realm field in the KDC-REQ.
Return value: Returns SHISHI_OK iff successful.
handle: shishi handle as allocated by
shishi_init()
.encticketpart: input EncTicketPart variable.
name_type: type of principial, see Shishi_name_type, usually SHISHI_NT_UNKNOWN.
principal: input array with principal name.
Set the client name field in the EncTicketPart.
Return value: Returns SHISHI_OK iff successful.
handle: shishi handle as allocated by
shishi_init()
.encticketpart: input EncTicketPart variable.
trtype: transitedencoding type, e.g. SHISHI_TR_DOMAIN_X500_COMPRESS.
trdata: actual transited realm data.
trdatalen: length of actual transited realm data.
Set the EncTicketPart.transited field to supplied value.
Return value: Returns SHISHI_OK iff succesful.
handle: shishi handle as allocated by
shishi_init()
.encticketpart: input EncTicketPart variable.
authtime: character buffer containing a generalized time string.
Set the EncTicketPart.authtime to supplied value.
Return value: Returns SHISHI_OK iff succesful.
handle: shishi handle as allocated by
shishi_init()
.encticketpart: input EncTicketPart variable.
endtime: character buffer containing a generalized time string.
Set the EncTicketPart.endtime to supplied value.
Return value: Returns SHISHI_OK iff succesful.
handle: Shishi library handle create by
shishi_init()
.encticketpart: EncTicketPart variable to get client name from.
client: pointer to newly allocated zero terminated string containing principal name. May be
NULL
(to only populateclientlen
).clientlen: pointer to length of
client
on output, excluding terminating zero. May beNULL
(to only populateclient
).Represent client principal name in EncTicketPart as zero-terminated string. The string is allocate by this function, and it is the responsibility of the caller to deallocate it. Note that the output length
clientlen
does not include the terminating zero.Return value: Returns SHISHI_OK iff successful.
handle: Shishi library handle create by
shishi_init()
.encticketpart: EncTicketPart variable to get client name and realm from.
client: pointer to newly allocated zero terminated string containing principal name and realm. May be
NULL
(to only populateclientlen
).clientlen: pointer to length of
client
on output, excluding terminating zero. May beNULL
(to only populateclient
).Convert cname and realm fields from EncTicketPart to printable principal name format. The string is allocate by this function, and it is the responsibility of the caller to deallocate it. Note that the output length
clientlen
does not include the terminating zero.Return value: Returns SHISHI_OK iff successful.