use of com.google.nigori.common.NigoriMessages.GetIndicesResponse in project nigori by ucam-cl-dtg.
the class CryptoNigoriDatastore method getIndices.
@Override
public List<Index> getIndices() throws NigoriCryptographyException, IOException, UnauthorisedException {
try {
GetIndicesResponse getResponse = protocol.getIndices(MessageLibrary.getIndicesRequestAsProtobuf(keyManager.getServerName(), keyManager.signer()));
if (getResponse == null) {
return null;
}
List<ByteString> indices = getResponse.getIndicesList();
List<Index> answer = new ArrayList<Index>(indices.size());
for (ByteString index : indices) {
answer.add(new Index(keyManager.decrypt(index.toByteArray())));
}
return answer;
} catch (NotFoundException e) {
return null;
}
}
Aggregations