if (read != 0x01) {
throw new KerberosTokenDecoderException("invalid kerberos token");
}
ApplicationRequestDecoder applicationRequestDecoder = new ApplicationRequestDecoder();
ApplicationRequest applicationRequest = applicationRequestDecoder.decode(toByteArray(asn1InputStream));
final int encryptionType = applicationRequest.getTicket().getEncPart().getEType().getOrdinal();
KerberosKey kerberosKey = getKrbKey(subject, encryptionType);
EncryptionKey encryptionKey =
new EncryptionKey(EncryptionType.getTypeByOrdinal(encryptionType), kerberosKey.getEncoded());
CipherTextHandler cipherTextHandler = new CipherTextHandler();
this.encTicketPart = (EncTicketPart) cipherTextHandler.unseal(
EncTicketPart.class, encryptionKey, applicationRequest.getTicket().getEncPart(), KeyUsage.NUMBER2);
} catch (KerberosException e) {
throw new KerberosTokenDecoderException(e);
} catch (IOException e) {
throw new KerberosTokenDecoderException(e);
}