{
boolean isNewEtype = KerberosUtils.isNewEncryptionType( requestedType );
ETypeInfo2 eTypeInfo2 = new ETypeInfo2();
ETypeInfo eTypeInfo = new ETypeInfo();
for ( EncryptionType encryptionType : encryptionTypes )
{
if ( !isNewEtype )
{
ETypeInfoEntry etypeInfoEntry = new ETypeInfoEntry( encryptionType, null );
eTypeInfo.addETypeInfoEntry( etypeInfoEntry );
}
ETypeInfo2Entry etypeInfo2Entry = new ETypeInfo2Entry( encryptionType );
eTypeInfo2.addETypeInfo2Entry( etypeInfo2Entry );
}
byte[] encTypeInfo = null;
byte[] encTypeInfo2 = null;
try
{
if ( !isNewEtype )
{
ByteBuffer buffer = ByteBuffer.allocate( eTypeInfo.computeLength() );
encTypeInfo = eTypeInfo.encode( buffer ).array();
}
ByteBuffer buffer = ByteBuffer.allocate( eTypeInfo2.computeLength() );
encTypeInfo2 = eTypeInfo2.encode( buffer ).array();
}