package org.apache.kerberos.kerb.spec.pa;
import org.apache.haox.asn1.type.Asn1FieldInfo;
import org.apache.haox.asn1.type.Asn1Integer;
import org.apache.kerberos.kerb.spec.KerberosTime;
import org.apache.kerberos.kerb.spec.KrbSequenceType;
/**
PA-ENC-TS-ENC ::= SEQUENCE {
patimestamp [0] KerberosTime -- client's time --,
pausec [1] Microseconds OPTIONAL
}
*/
public class PaEncTsEnc extends KrbSequenceType {
private static int PATIMESTAMP = 0;
private static int PAUSEC = 1;
static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
new Asn1FieldInfo(PATIMESTAMP, 1, KerberosTime.class),
new Asn1FieldInfo(PAUSEC, 2, Asn1Integer.class)
};
public PaEncTsEnc() {
super(fieldInfos);
}
public KerberosTime getPaTimestamp() {
return getFieldAsTime(PATIMESTAMP);
}
public void setPaTimestamp(KerberosTime paTimestamp) {
setFieldAs(PATIMESTAMP, paTimestamp);
}
public int getPaUsec() {
return getFieldAsInt(PAUSEC);
}
public void setPaUsec(int paUsec) {
setFieldAsInt(PAUSEC, paUsec);
}
public KerberosTime getAllTime() {
KerberosTime paTimestamp = getPaTimestamp();
return paTimestamp.extend(getPaUsec() / 1000);
}
}