#![doc = include_str!("../README.md")]
#![no_std]
#[cfg(feature = "otp")]
pub mod otp;
use rasn::prelude::*;
pub type HostAddresses = SequenceOf<HostAddress>;
pub type AdMandatoryForKdc = AuthorizationData;
pub type AdIfRelevant = AuthorizationData;
pub type EtypeInfo2 = SequenceOf<EtypeInfo2Entry>;
pub type EtypeInfo = SequenceOf<EtypeInfoEntry>;
pub type PaEncTimestamp = EncryptedData;
pub type LastReq = SequenceOf<LastReqValue>;
pub type MethodData = SequenceOf<PaData>;
pub type KerberosString = GeneralString;
pub type ETypeList = SequenceOf<i32>;
pub type Realm = KerberosString;
pub type Microseconds = Integer;
pub const OID: &Oid = Oid::ISO_IDENTIFIED_ORGANISATION_DOD_INTERNET_SECURITY_KERBEROS_V5;
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PrincipalName {
#[rasn(tag(explicit(0)))]
pub r#type: i32,
#[rasn(tag(explicit(1)))]
pub string: SequenceOf<KerberosString>,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(delegate)]
pub struct KerberosTime(pub GeneralizedTime);
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct HostAddress {
#[rasn(tag(explicit(0)))]
pub addr_type: i32,
#[rasn(tag(explicit(1)))]
pub address: OctetString,
}
impl HostAddress {
pub const IPV4: i32 = 2;
pub const DIRECTIONAL: i32 = 3;
pub const CHAOS_NET: i32 = 5;
pub const XNS: i32 = 6;
pub const ISO: i32 = 7;
pub const DECNET_PHASE_IV: i32 = 12;
pub const APPLE_TALK_DDP: i32 = 16;
pub const NET_BIOS: i32 = 20;
pub const IPV6: i32 = 24;
}
pub type AuthorizationData = SequenceOf<AuthorizationDataValue>;
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct AuthorizationDataValue {
#[rasn(tag(explicit(0)))]
pub r#type: i32,
#[rasn(tag(explicit(1)))]
pub data: OctetString,
}
impl AuthorizationDataValue {
pub const IF_RELEVANT: i32 = 1;
pub const KDC_ISSUED: i32 = 4;
pub const AND_OR: i32 = 5;
pub const MANDATORY_FOR_KDC: i32 = 8;
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PaData {
#[rasn(tag(explicit(1)))]
pub r#type: i32,
#[rasn(tag(explicit(2)))]
pub value: OctetString,
}
pub type KerberosFlags = BitString;
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct EncryptedData {
#[rasn(tag(explicit(0)))]
pub etype: i32,
#[rasn(tag(explicit(1)))]
pub kvno: Option<u32>,
#[rasn(tag(explicit(2)))]
pub cipher: OctetString,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct EncryptionKey {
#[rasn(tag(explicit(0)))]
pub r#type: i32,
#[rasn(tag(explicit(1)))]
pub value: OctetString,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Checksum {
#[rasn(tag(explicit(0)))]
pub r#type: i32,
#[rasn(tag(explicit(1)))]
pub checksum: OctetString,
}
pub use body::*;
mod body {
use super::*;
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 1)))]
pub struct Ticket {
#[rasn(tag(explicit(0)))]
pub tkt_vno: Integer,
#[rasn(tag(explicit(1)))]
pub realm: Realm,
#[rasn(tag(explicit(2)))]
pub sname: PrincipalName,
#[rasn(tag(explicit(3)))]
pub enc_part: EncryptedData,
}
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 3)))]
pub struct EncTicketPart {
#[rasn(tag(explicit(0)))]
pub flags: TicketFlags,
#[rasn(tag(explicit(1)))]
pub key: EncryptionKey,
#[rasn(tag(explicit(2)))]
pub crealm: Realm,
#[rasn(tag(explicit(3)))]
pub cname: PrincipalName,
#[rasn(tag(explicit(4)))]
pub transited: TransitedEncoding,
#[rasn(tag(explicit(5)))]
pub auth_time: KerberosTime,
#[rasn(tag(explicit(6)))]
pub start_time: Option<KerberosTime>,
#[rasn(tag(explicit(7)))]
pub end_time: KerberosTime,
#[rasn(tag(explicit(8)))]
pub renew_till: Option<KerberosTime>,
#[rasn(tag(explicit(9)))]
pub caddr: Option<HostAddresses>,
#[rasn(tag(explicit(10)))]
pub authorization_data: Option<AuthorizationData>,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct TransitedEncoding {
#[rasn(tag(explicit(0)))]
pub r#type: i32,
#[rasn(tag(explicit(1)))]
pub contents: OctetString,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(delegate)]
pub struct TicketFlags(pub KerberosFlags);
impl TicketFlags {
pub fn reserved() -> Self {
Self(KerberosFlags::from_element(0))
}
pub fn forwardable() -> Self {
Self(KerberosFlags::from_element(1))
}
pub fn forwarded() -> Self {
Self(KerberosFlags::from_element(2))
}
pub fn proxiable() -> Self {
Self(KerberosFlags::from_element(3))
}
pub fn proxy() -> Self {
Self(KerberosFlags::from_element(4))
}
pub fn may_postdate() -> Self {
Self(KerberosFlags::from_element(0x8))
}
pub fn postdated() -> Self {
Self(KerberosFlags::from_element(0x10))
}
pub fn invalid() -> Self {
Self(KerberosFlags::from_element(0x20))
}
pub fn renewable() -> Self {
Self(KerberosFlags::from_element(0x40))
}
pub fn initial() -> Self {
Self(KerberosFlags::from_element(0x80))
}
pub fn pre_authent() -> Self {
Self(KerberosFlags::from_slice(&[0x1, 00]))
}
pub fn hw_authent() -> Self {
Self(KerberosFlags::from_slice(&[0x2, 00]))
}
pub fn transited_policy_checked() -> Self {
Self(KerberosFlags::from_slice(&[0x4, 00]))
}
pub fn ok_as_delegate() -> Self {
Self(KerberosFlags::from_slice(&[0x80, 0]))
}
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 10)), delegate)]
pub struct AsReq(pub KdcReq);
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 12)), delegate)]
pub struct TgsReq(pub KdcReq);
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct KdcReq {
#[rasn(tag(explicit(1)))]
pub pvno: Integer,
#[rasn(tag(explicit(2)))]
pub msg_type: Integer,
#[rasn(tag(explicit(3)))]
pub padata: Option<SequenceOf<PaData>>,
#[rasn(tag(explicit(4)))]
pub req_body: KdcReqBody,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct KdcReqBody {
#[rasn(tag(explicit(0)))]
pub kdc_options: KdcOptions,
#[rasn(tag(explicit(1)))]
pub cname: Option<PrincipalName>,
#[rasn(tag(explicit(2)))]
pub realm: Realm,
#[rasn(tag(explicit(3)))]
pub sname: Option<PrincipalName>,
#[rasn(tag(explicit(4)))]
pub from: Option<KerberosTime>,
#[rasn(tag(explicit(5)))]
pub till: KerberosTime,
#[rasn(tag(explicit(6)))]
pub rtime: Option<KerberosTime>,
#[rasn(tag(explicit(7)))]
pub nonce: u32,
#[rasn(tag(explicit(8)))]
pub etype: SequenceOf<i32>,
#[rasn(tag(explicit(9)))]
pub addresses: Option<HostAddresses>,
#[rasn(tag(explicit(10)))]
pub enc_authorization_data: Option<EncryptedData>,
#[rasn(tag(explicit(11)))]
pub additional_tickets: Option<SequenceOf<Ticket>>,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(delegate)]
pub struct KdcOptions(pub KerberosFlags);
impl KdcOptions {
pub fn reserved() -> Self {
Self(KerberosFlags::from_element(0))
}
pub fn forwardable() -> Self {
Self(KerberosFlags::from_element(1))
}
pub fn forwarded() -> Self {
Self(KerberosFlags::from_element(2))
}
pub fn proxiable() -> Self {
Self(KerberosFlags::from_element(4))
}
pub fn proxy() -> Self {
Self(KerberosFlags::from_element(0x8))
}
pub fn allow_postdate() -> Self {
Self(KerberosFlags::from_element(0x10))
}
pub fn postdated() -> Self {
Self(KerberosFlags::from_element(0x20))
}
pub fn renewable() -> Self {
Self(KerberosFlags::from_element(0x80))
}
pub fn opt_hardware_auth() -> Self {
Self(KerberosFlags::from_slice(&[0x4, 00]))
}
pub fn disable_transited_check() -> Self {
Self(KerberosFlags::from_slice(&[0x4, 00, 00, 00]))
}
pub fn renewable_ok() -> Self {
Self(KerberosFlags::from_slice(&[0x8, 00, 00, 00]))
}
pub fn enc_tkt_in_skey() -> Self {
Self(KerberosFlags::from_slice(&[0x10, 00, 00, 00]))
}
pub fn renew() -> Self {
Self(KerberosFlags::from_slice(&[0x40, 00, 00, 00]))
}
pub fn validate() -> Self {
Self(KerberosFlags::from_slice(&[0x80, 00, 00, 00]))
}
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 11)), delegate)]
pub struct AsRep(pub KdcRep);
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 13)), delegate)]
pub struct TgsRep(pub KdcRep);
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct KdcRep {
#[rasn(tag(explicit(0)))]
pub pvno: Integer,
#[rasn(tag(explicit(1)))]
pub msg_type: Integer,
#[rasn(tag(explicit(2)))]
pub padata: Option<SequenceOf<PaData>>,
#[rasn(tag(explicit(3)))]
pub crealm: Realm,
#[rasn(tag(explicit(4)))]
pub cname: PrincipalName,
#[rasn(tag(explicit(5)))]
pub ticket: Ticket,
#[rasn(tag(explicit(6)))]
pub enc_part: EncryptedData,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 25)), delegate)]
pub struct EncAsRepPart(pub EncKdcRepPart);
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 26)), delegate)]
pub struct EncTgsRepPart(pub EncKdcRepPart);
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct EncKdcRepPart {
#[rasn(tag(explicit(0)))]
pub key: EncryptionKey,
#[rasn(tag(explicit(1)))]
pub last_req: LastReq,
#[rasn(tag(explicit(2)))]
pub nonce: u32,
#[rasn(tag(explicit(3)))]
pub key_expiration: Option<KerberosTime>,
#[rasn(tag(explicit(4)))]
pub flags: TicketFlags,
#[rasn(tag(explicit(5)))]
pub auth_time: KerberosTime,
#[rasn(tag(explicit(6)))]
pub start_time: Option<KerberosTime>,
#[rasn(tag(explicit(7)))]
pub end_time: KerberosTime,
#[rasn(tag(explicit(8)))]
pub renew_till: Option<KerberosTime>,
#[rasn(tag(explicit(9)))]
pub srealm: Realm,
#[rasn(tag(explicit(10)))]
pub sname: PrincipalName,
#[rasn(tag(explicit(11)))]
pub caddr: Option<HostAddresses>,
#[rasn(tag(explicit(12)))]
pub encrypted_pa_data: Option<SequenceOf<PaData>>,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct LastReqValue {
#[rasn(tag(explicit(0)))]
pub r#type: i32,
#[rasn(tag(explicit(1)))]
pub value: KerberosTime,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 14)))]
pub struct ApReq {
#[rasn(tag(explicit(0)))]
pub pvno: Integer,
#[rasn(tag(explicit(1)))]
pub msg_type: Integer,
#[rasn(tag(explicit(2)))]
pub ap_options: ApOptions,
#[rasn(tag(explicit(3)))]
pub ticket: Ticket,
#[rasn(tag(explicit(4)))]
pub authenticator: EncryptedData,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(delegate)]
pub struct ApOptions(pub KerberosFlags);
impl ApOptions {
pub fn reserved() -> Self {
Self(KerberosFlags::from_element(0))
}
pub fn use_session_key() -> Self {
Self(KerberosFlags::from_element(1))
}
pub fn mutual_required() -> Self {
Self(KerberosFlags::from_element(2))
}
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 2)))]
pub struct Authenticator {
#[rasn(tag(explicit(0)))]
pub authenticator_vno: Integer,
#[rasn(tag(explicit(1)))]
pub crealm: Realm,
#[rasn(tag(explicit(2)))]
pub cname: PrincipalName,
#[rasn(tag(explicit(3)))]
pub cksum: Option<Checksum>,
#[rasn(tag(explicit(4)))]
pub cusec: Microseconds,
#[rasn(tag(explicit(5)))]
pub ctime: KerberosTime,
#[rasn(tag(explicit(6)))]
pub subkey: Option<EncryptionKey>,
#[rasn(tag(explicit(7)))]
pub seq_number: Option<u32>,
#[rasn(tag(explicit(8)))]
pub authorization_data: Option<AuthorizationData>,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 15)))]
pub struct ApRep {
#[rasn(tag(explicit(0)))]
pub pvno: Integer,
#[rasn(tag(explicit(1)))]
pub msg_type: Integer,
#[rasn(tag(explicit(2)))]
pub enc_part: EncryptedData,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 27)))]
pub struct EncApRepPart {
#[rasn(tag(explicit(0)))]
pub ctime: KerberosTime,
#[rasn(tag(explicit(1)))]
pub cusec: Microseconds,
#[rasn(tag(explicit(2)))]
pub subkey: Option<EncryptionKey>,
#[rasn(tag(explicit(3)))]
pub seq_number: Option<u32>,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 20)))]
pub struct KrbSafe {
#[rasn(tag(explicit(0)))]
pub pvno: Integer,
#[rasn(tag(explicit(1)))]
pub msg_type: Integer,
#[rasn(tag(explicit(2)))]
pub body: KrbSafeBody,
#[rasn(tag(explicit(3)))]
pub cksum: Checksum,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct KrbSafeBody {
#[rasn(tag(explicit(0)))]
pub user_data: OctetString,
#[rasn(tag(explicit(1)))]
pub timestamp: Option<KerberosTime>,
#[rasn(tag(explicit(2)))]
pub usec: Option<Microseconds>,
#[rasn(tag(explicit(3)))]
pub seq_number: Option<u32>,
#[rasn(tag(explicit(4)))]
pub s_address: HostAddress,
#[rasn(tag(explicit(5)))]
pub r_address: Option<HostAddress>,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 21)))]
pub struct KrbPriv {
#[rasn(tag(explicit(0)))]
pub pvno: Integer,
#[rasn(tag(explicit(1)))]
pub msg_type: Integer,
#[rasn(tag(explicit(3)))]
pub enc_part: EncryptedData,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 28)))]
pub struct EncKrbPrivPart {
#[rasn(tag(explicit(0)))]
pub user_data: OctetString,
#[rasn(tag(explicit(1)))]
pub timestamp: Option<KerberosTime>,
#[rasn(tag(explicit(2)))]
pub usec: Option<Microseconds>,
#[rasn(tag(explicit(3)))]
pub seq_number: Option<u32>,
#[rasn(tag(explicit(4)))]
pub sender_address: HostAddress,
#[rasn(tag(explicit(5)))]
pub recipient_address: Option<HostAddress>,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 22)))]
pub struct KrbCred {
#[rasn(tag(explicit(0)))]
pub pvno: Integer,
#[rasn(tag(explicit(1)))]
pub msg_type: Integer,
#[rasn(tag(explicit(2)))]
pub tickets: SequenceOf<Ticket>,
#[rasn(tag(explicit(3)))]
pub enc_part: EncryptedData,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 29)))]
pub struct EncKrbCredPart {
#[rasn(tag(explicit(0)))]
pub ticket_info: SequenceOf<KrbCredInfo>,
#[rasn(tag(explicit(1)))]
pub nonce: Option<u32>,
#[rasn(tag(explicit(2)))]
pub timestamp: Option<KerberosTime>,
#[rasn(tag(explicit(3)))]
pub usec: Option<Microseconds>,
#[rasn(tag(explicit(4)))]
pub sender_address: Option<HostAddress>,
#[rasn(tag(explicit(5)))]
pub recipient_address: Option<HostAddress>,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct KrbCredInfo {
#[rasn(tag(explicit(0)))]
pub key: EncryptionKey,
#[rasn(tag(explicit(1)))]
pub prealm: Option<Realm>,
#[rasn(tag(explicit(2)))]
pub pname: Option<PrincipalName>,
#[rasn(tag(explicit(3)))]
pub flags: Option<TicketFlags>,
#[rasn(tag(explicit(4)))]
pub auth_time: Option<KerberosTime>,
#[rasn(tag(explicit(5)))]
pub start_time: Option<KerberosTime>,
#[rasn(tag(explicit(6)))]
pub end_time: Option<KerberosTime>,
#[rasn(tag(explicit(7)))]
pub renew_till: Option<KerberosTime>,
#[rasn(tag(explicit(8)))]
pub srealm: Option<Realm>,
#[rasn(tag(explicit(9)))]
pub sname: Option<PrincipalName>,
#[rasn(tag(explicit(10)))]
pub caddr: Option<HostAddresses>,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 30)))]
pub struct KrbError {
#[rasn(tag(explicit(0)))]
pub pvno: Integer,
#[rasn(tag(explicit(1)))]
pub msg_type: Integer,
#[rasn(tag(explicit(2)))]
pub ctime: Option<KerberosTime>,
#[rasn(tag(explicit(3)))]
pub cusec: Option<Microseconds>,
#[rasn(tag(explicit(4)))]
pub stime: KerberosTime,
#[rasn(tag(explicit(5)))]
pub susec: Microseconds,
#[rasn(tag(explicit(6)))]
pub error_code: i32,
#[rasn(tag(explicit(7)))]
pub crealm: Option<Realm>,
#[rasn(tag(explicit(8)))]
pub cname: Option<PrincipalName>,
#[rasn(tag(explicit(9)))]
pub realm: Realm,
#[rasn(tag(explicit(10)))]
pub sname: PrincipalName,
#[rasn(tag(explicit(11)))]
pub e_text: Option<KerberosString>,
#[rasn(tag(explicit(12)))]
pub e_data: Option<OctetString>,
}
pub type TypedData = SequenceOf<TypedDataItem>;
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct TypedDataItem {
#[rasn(tag(explicit(0)))]
pub r#type: i32,
#[rasn(tag(explicit(1)))]
pub value: Option<OctetString>,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PaEncTsEnc {
#[rasn(tag(explicit(0)))]
pub patimestamp: KerberosTime,
#[rasn(tag(explicit(1)))]
pub pausec: Option<Microseconds>,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct EtypeInfoEntry {
#[rasn(tag(explicit(0)))]
pub etype: i32,
#[rasn(tag(explicit(1)))]
pub salt: Option<OctetString>,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct EtypeInfo2Entry {
#[rasn(tag(explicit(0)))]
pub etype: i32,
#[rasn(tag(explicit(1)))]
pub salt: Option<KerberosString>,
#[rasn(tag(explicit(2)))]
pub s2kparams: Option<OctetString>,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct AdKdcIssued {
#[rasn(tag(explicit(0)))]
pub ad_checksum: Checksum,
#[rasn(tag(explicit(1)))]
pub realm: Option<Realm>,
#[rasn(tag(explicit(2)))]
pub sname: Option<PrincipalName>,
#[rasn(tag(explicit(3)))]
pub elements: AuthorizationData,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct AdAndOr {
#[rasn(tag(explicit(0)))]
pub condition_count: i32,
#[rasn(tag(explicit(1)))]
pub elements: AuthorizationData,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct AdCammac {
#[rasn(tag(explicit(0)))]
pub elements: AuthorizationData,
#[rasn(tag(explicit(1)))]
pub kdc_verifier: Option<VerifierMac>,
#[rasn(tag(explicit(2)))]
pub svc_verifier: Option<VerifierMac>,
#[rasn(tag(explicit(3)))]
pub other_verifiers: SequenceOf<Verifier>,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[non_exhaustive]
#[rasn(choice)]
pub enum Verifier {
Mac(VerifierMac),
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct VerifierMac {
#[rasn(tag(explicit(0)))]
pub identifier: Option<PrincipalName>,
#[rasn(tag(explicit(1)))]
pub kvno: Option<u32>,
#[rasn(tag(explicit(2)))]
pub enctype: Option<i32>,
#[rasn(tag(explicit(3)))]
pub mac: Checksum,
}
#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[non_exhaustive]
pub struct AdLoginAlias {
#[rasn(tag(explicit(0)))]
pub login_aliases: SequenceOf<PrincipalName>,
}
impl AdLoginAlias {
pub fn new(login_aliases: SequenceOf<PrincipalName>) -> Self {
Self { login_aliases }
}
}