public String getKNAlgorithmIdentifier(String unique, Report report, File keyFile) throws FileNotFoundException, IOException, MalformedKeyException{
ArrayList<String> array = common.readFile(keyFile);
int i = 0;
if(array.size() < 1){
throw new MalformedKeyException(unique, report, String.format(ExceptionString.MALFORMEDKEYEXCEPTIONZEROLINES.getExceptionString()));
}
boolean iterate;
for(String line : array){
line = line.trim();
if(line.startsWith("\"")){
line = (String) line.subSequence(1, line.length());
}
iterate = true;
i = 0;
while(iterate){
if (!line.startsWith(getKNAlgorithmIdentifierHelper(i))) {
i++;
if (getKNAlgorithmIdentifierHelper(i) == null) {
iterate = false;
}
} else {
return getKNAlgorithmIdentifierHelper(i);
}
}
}
throw new MalformedKeyException(unique, report, String.format(ExceptionString.MALFORMEDKEYEXCEPTIONNOKEY.getExceptionString()));
}