privPart.setSenderAddress( new HostAddress( InetAddress.getLocalHost() ) );
// get the subsession key from the Authenticator
EncryptionKey subSessionKey = authenticator.getSubKey();
EncryptedData encPrivPart;
try
{
encPrivPart = cipherTextHandler.seal( subSessionKey, privPart, KeyUsage.KRB_PRIV_ENC_PART_CHOSEN_KEY );
}
catch ( KerberosException ke )
{
throw new ChangePasswordException( ChangePasswdErrorType.KRB5_KPASSWD_SOFTERROR, ke );
}
KrbPriv privateMessage = new KrbPriv();
privateMessage.setEncPart( encPrivPart );
// Begin AP_REP generation
EncApRepPart repPart = new EncApRepPart();
repPart.setCTime( authenticator.getCtime() );
repPart.setCusec( authenticator.getCusec() );
if ( authenticator.getSeqNumber() != null )
{
repPart.setSeqNumber( authenticator.getSeqNumber() );
}
repPart.setSubkey( subSessionKey );
EncryptedData encRepPart;
try
{
encRepPart = cipherTextHandler.seal( ticket.getEncTicketPart().getKey(), repPart, KeyUsage.AP_REP_ENC_PART_SESS_KEY );
}