public List<Revision> getRevisions(Index index) throws NigoriCryptographyException,
UnsupportedEncodingException, IOException, UnauthorisedException {
byte[] encIndex = keyManager.encryptDeterministically(index.getBytes());
try {
GetRevisionsResponse getResponse =
protocol.getRevisions(MessageLibrary.getRevisionsRequestAsProtobuf(
keyManager.getServerName(), keyManager.signer(), encIndex));
if (getResponse == null) {
return null;
}
List<ByteString> revisions = getResponse.getRevisionsList();
List<Revision> answer = new ArrayList<Revision>(revisions.size());
for (ByteString revision : revisions) {
answer.add(new Revision(keyManager.decrypt(revision.toByteArray())));
}
return answer;