package com.kryptnostic.storage.v1.http;

import java.util.UUID;

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;
import retrofit.http.Path;

public interface CryptoKeyStorageApi {
    final String CONTROLLER         = "/keys";
    final String PRIVATE            = "/private";
    final String SEARCH_PRIVATE     = "/searchprivate";
    final String HASH               = "/hash";
    final String RSA_PUB            = "/rsapublic";
    final String ID                 = "id";
    final String ID_PATH            = "/{" + ID + "}";

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

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

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

    @GET( CONTROLLER + SEARCH_PRIVATE )
    byte[] getFHESearchPriatveKeyForUser() throws BadRequestException;

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

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

    @GET( CONTROLLER + RSA_PUB )
    byte[] getRsaPublicKeyForUser( @Path( ID ) UUID userId ) throws BadRequestException;

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

    @GET( CONTROLLER + RSA_PUB )
    byte[] getRsaPublicKeyForCurrentUser() throws BadRequestException;
}
@@ -268,17 +268,18 @@
 t.http.P
-U
+OS
 T;%0Aimpor
@@ -690,33 +690,34 @@
 D + %22%7D%22;%0A%0A    @P
-U
+OS
 T( CONTROLLER + 
@@ -936,33 +936,34 @@
 ception;%0A%0A    @P
-U
+OS
 T( CONTROLLER + 
@@ -1201,33 +1201,34 @@
 ception;%0A%0A    @P
-U
+OS
 T( CONTROLLER + 
@@ -1570,17 +1570,18 @@
 %0A%0A    @P
-U
+OS
 T( CONTR

use different request types