package com.kryptnostic.storage.v1.http;

import java.util.UUID;

import com.kryptnostic.kodex.v1.constants.Names;
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 PUBLIC             = "/public";
    final String HASH               = "/hash";
    final String ID                 = "id";

    public static final class PARAM {
        private PARAM() {}

        public static final String ID             = "/{" + Names.ID_FIELD + "}";
    }

    @PUT( CONTROLLER + PRIVATE + PARAM.ID )
    BasicResponse<String> addFHEPrivateKeyForUser( @Path( Names.ID_FIELD ) UUID id, @Body byte[] key ) throws BadRequestException;

    @GET( CONTROLLER + PRIVATE + PARAM.ID )
    byte[] getFHEPrivateKeyForUser( @Path( Names.ID_FIELD ) UUID id ) throws BadRequestException;

    @PUT( CONTROLLER + PUBLIC + PARAM.ID )
    BasicResponse<String> addFHEPublicKeyForUser( @Path( Names.ID_FIELD ) UUID id, @Body byte[] key ) throws BadRequestException;

    @GET( CONTROLLER + PUBLIC + PARAM.ID )
    byte[] getFHEPublicKeyForUser( @Path( Names.ID_FIELD ) UUID id ) throws BadRequestException;

    @PUT( CONTROLLER + HASH + PARAM.ID )
    BasicResponse<String> addHashFunctionForUser( @Path( Names.ID_FIELD ) UUID id, @Body byte[] key ) throws BadRequestException;

    @GET( CONTROLLER + HASH + PARAM.ID )
    byte[] getHashFunctionForUser( @Path( Names.ID_FIELD ) UUID id ) throws BadRequestException;

}
@@ -846,27 +846,27 @@
 nse%3CString%3E 
-add
+set
 FHEPrivateKe
@@ -1168,19 +1168,19 @@
 String%3E 
-add
+set
 FHEPubli
@@ -1485,11 +1485,11 @@
 ng%3E 
-add
+set
 Hash

use set instead of add