private static byte[] preparePreAuthenticationError( List<EncryptionType> clientEncryptionTypes,
List<EncryptionType> serverEncryptionTypes )
{
PaData[] paDataSequence = new PaData[2];
PaData paData = new PaData();
paData.setPaDataType( PaDataType.PA_ENC_TIMESTAMP );
paData.setPaDataValue( Strings.EMPTY_BYTES );
paDataSequence[0] = paData;
ETypeInfo eTypeInfo = new ETypeInfo();
for ( EncryptionType encryptionType : clientEncryptionTypes )
{
if ( serverEncryptionTypes.contains( encryptionType ) )
{
ETypeInfoEntry etypeInfoEntry = new ETypeInfoEntry( encryptionType, null );
eTypeInfo.addETypeInfoEntry( etypeInfoEntry );
}
}
byte[] encTypeInfo = null;
try
{
ByteBuffer buffer = ByteBuffer.allocate( eTypeInfo.computeLength() );
encTypeInfo = eTypeInfo.encode( buffer ).array();
}
catch ( EncoderException ioe )
{
return null;
}
PaData responsePaData = new PaData( PaDataType.PA_ENCTYPE_INFO, encTypeInfo );
MethodData methodData = new MethodData();
methodData.addPaData( responsePaData );
try