package com.kryptnostic.storage.v1.http;

import com.kryptnostic.kodex.v1.exceptions.types.BadRequestException;
import com.kryptnostic.kodex.v1.models.response.BasicResponse;

import retrofit.http.Body;
import retrofit.http.GET;
import retrofit.http.PUT;

public interface CryptoKeyStorageApi {
    final String CONTROLLER         = "/keys";
    final String PRIVATE            = "/private";
    final String PUBLIC             = "/public";
    final String HASH               = "/hash";
    final String ID                 = "id";

    @PUT( CONTROLLER + PRIVATE )
    BasicResponse<String> setFHEPrivateKeyForCurrentUser( @Body byte[] key ) throws BadRequestException;

    @GET( CONTROLLER + PRIVATE )
    byte[] getFHEPrivateKeyForCurrentUser() throws BadRequestException;

    @PUT( CONTROLLER + PUBLIC )
    BasicResponse<String> setFHEPublicKeyForCurrentUser( @Body byte[] key ) throws BadRequestException;

    @GET( CONTROLLER + PUBLIC )
    byte[] getFHEPublicKeyForUser() throws BadRequestException;

    @PUT( CONTROLLER + HASH )
    BasicResponse<String> setHashFunctionForCurrentUser( @Body byte[] key ) throws BadRequestException;

    @GET( CONTROLLER + HASH )
    byte[] getHashFunctionForCurrentUser() throws BadRequestException;

}
@@ -406,37 +406,44 @@
 ing 
-PUBLIC             = %22/public
+SEARCH_PRIVATE     = %22/searchprivate
 %22;%0A 
@@ -488,16 +488,68 @@
 /hash%22;%0A
+    final String RSA_PUB            = %22/rsapublic%22;%0A
     fina
@@ -849,30 +849,38 @@
 ONTROLLER + 
-PUBLIC
+SEARCH_PRIVATE
  )%0A    Basic
@@ -898,30 +898,37 @@
 ring%3E setFHE
-Public
+SearchPrivate
 KeyForCurren
@@ -1009,14 +1009,22 @@
 R + 
-PUBLIC
+SEARCH_PRIVATE
  )%0A 
@@ -1043,14 +1043,21 @@
 tFHE
-Public
+SearchPriatve
 KeyF
@@ -1331,9 +1331,237 @@
 ption;%0A%0A
+    @PUT( CONTROLLER + RSA_PUB )%0A    BasicResponse%3CString%3E setRsaPublicKey( @Body byte%5B%5D key ) throws BadRequestException;%0A%0A    @GET( CONTROLLER + RSA_PUB )%0A    byte%5B%5D getRsaPublicKeyForCurrentUser() throws BadRequestException;%0A
 %7D

support searchprivate and rsapublic keys