1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
use crate::{
    AuthorizationData, EncryptionKey, HostAddresses, KerberosTime,
    PrincipalName, Realm, TicketFlags, TransitedEncoding,
};
use red_asn1::Asn1Object;
use red_asn1_derive::Sequence;

/// (*EncTicketPart*) Encrypted part of a *Ticket*.
/// Defined in RFC4120, section 5.3.
/// ```asn1
/// -- 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
/// }
/// ```
#[derive(Sequence, Default, Debug, Clone, PartialEq)]
#[seq(application_tag = 3)]
pub struct EncTicketPart {
    #[seq_field(context_tag = 0)]
    pub flags: TicketFlags,
    #[seq_field(context_tag = 1)]
    pub key: EncryptionKey,
    #[seq_field(context_tag = 2)]
    pub crealm: Realm,
    #[seq_field(context_tag = 3)]
    pub cname: PrincipalName,
    #[seq_field(context_tag = 4)]
    pub transited: TransitedEncoding,
    #[seq_field(context_tag = 5)]
    pub authtime: KerberosTime,
    #[seq_field(context_tag = 6)]
    pub starttime: Option<KerberosTime>,
    #[seq_field(context_tag = 7)]
    pub endtime: KerberosTime,
    #[seq_field(context_tag = 8)]
    pub renew_till: Option<KerberosTime>,
    #[seq_field(context_tag = 9)]
    pub caddr: Option<HostAddresses>,
    #[seq_field(context_tag = 10)]
    pub authorization_data: Option<AuthorizationData>,
}