func (o *Operation) deleteHolderProfileHandler(rw http.ResponseWriter, req *http.Request) {
	profileID := mux.Vars(req)[profileIDPathParam]
	err := o.profileStore.DeleteHolderProfile(profileID)
	if err != nil {
		commhttp.WriteErrorResponse(rw, http.StatusBadRequest, err.Error())
		return
	}
}
DeleteHolderProfile swagger:route DELETE /holder/profile/{id} holder deleteHolderProfileReq

Deletes holder profile.

Responses:
default: genericError
200: emptyRes
package operation
import (
	"crypto/rand"
	"crypto/tls"
	"encoding/base64"
	"encoding/json"
	"errors"
	"fmt"
	"net/http"
	"time"
	"github.com/gorilla/mux"
	ariescrypto "github.com/hyperledger/aries-framework-go/pkg/crypto"
	"github.com/hyperledger/aries-framework-go/pkg/doc/verifiable"
	vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr"
	"github.com/hyperledger/aries-framework-go/pkg/kms"
	ariesstorage "github.com/hyperledger/aries-framework-go/spi/storage"
	"github.com/piprate/json-gold/ld"
	"github.com/trustbloc/edge-service/pkg/doc/vc/crypto"
	vcprofile "github.com/trustbloc/edge-service/pkg/doc/vc/profile"
	"github.com/trustbloc/edge-service/pkg/internal/common/support"
	commondid "github.com/trustbloc/edge-service/pkg/restapi/internal/common/did"
	commhttp "github.com/trustbloc/edge-service/pkg/restapi/internal/common/http"
	"github.com/trustbloc/edge-service/pkg/restapi/model"
)
const (
	profileIDPathParam = "profileID"
	holderProfileEndpoint       = "/holder/profile"
	getHolderProfileEndpoint    = holderProfileEndpoint + "/" + "{" + profileIDPathParam + "}"
	deleteHolderProfileEndpoint = holderProfileEndpoint + "/" + "{" + profileIDPathParam + "}"
	signPresentationEndpoint    = "/" + "{" + profileIDPathParam + "}" + "/prove/presentations"
	deriveCredentialsEndpoint   = "/" + "{" + profileIDPathParam + "}" + "/credentials/derive"
	invalidRequestErrMsg = "Invalid request"
)
type Handler interface {
	Path() string
	Method() string
	Handle() http.HandlerFunc
}
type commonDID interface {
	CreateDID(keyType, signatureType, did, privateKey, keyID, purpose string,
		registrar model.UNIRegistrar) (string, string, error)
}
func New(config *Config) (*Operation, error) {
	p, err := vcprofile.New(config.StoreProvider)
	if err != nil {
		return nil, err
	}
	svc := &Operation{
		vdr:          config.VDRI,
		profileStore: p,
		commonDID: commondid.New(&commondid.Config{
			VDRI: config.VDRI, KeyManager: config.KeyManager,
			Domain: config.Domain, TLSConfig: config.TLSConfig,
			DIDAnchorOrigin: config.DIDAnchorOrigin,
		}),
		crypto:         crypto.New(config.KeyManager, config.Crypto, config.VDRI, config.DocumentLoader),
		documentLoader: config.DocumentLoader,
	}
	return svc, nil
}
type Config struct {
	StoreProvider   ariesstorage.Provider
	KeyManager      keyManager
	VDRI            vdrapi.Registry
	Domain          string
	TLSConfig       *tls.Config
	Crypto          ariescrypto.Crypto
	DIDAnchorOrigin string
	DocumentLoader  ld.DocumentLoader
}
type keyManager interface {
	kms.KeyManager
}
type Operation struct {
	commonDID      commonDID
	profileStore   *vcprofile.Profile
	crypto         *crypto.Crypto
	vdr            vdrapi.Registry
	documentLoader ld.DocumentLoader
}
func (o *Operation) GetRESTHandlers() []Handler {
	return []Handler{
		support.NewHTTPHandler(holderProfileEndpoint, http.MethodPost, o.createHolderProfileHandler),
		support.NewHTTPHandler(getHolderProfileEndpoint, http.MethodGet, o.getHolderProfileHandler),
		support.NewHTTPHandler(deleteHolderProfileEndpoint, http.MethodDelete, o.deleteHolderProfileHandler),
		support.NewHTTPHandler(signPresentationEndpoint, http.MethodPost, o.signPresentationHandler),
		support.NewHTTPHandler(deriveCredentialsEndpoint, http.MethodPost, o.deriveCredentialsHandler),
	}
}
func (o *Operation) createHolderProfileHandler(rw http.ResponseWriter, req *http.Request) {
	request := &HolderProfileRequest{}
	if err := json.NewDecoder(req.Body).Decode(request); err != nil {
		commhttp.WriteErrorResponse(rw, http.StatusBadRequest, fmt.Sprintf(invalidRequestErrMsg+": %s", err.Error()))
		return
	}
	if err := validateHolderProfileRequest(request); err != nil {
		commhttp.WriteErrorResponse(rw, http.StatusBadRequest, err.Error())
		return
	}
	profile, err := o.profileStore.GetHolderProfile(request.Name)
	if err != nil && !errors.Is(err, ariesstorage.ErrDataNotFound) {
		commhttp.WriteErrorResponse(rw, http.StatusBadRequest, err.Error())
		return
	}
	if profile != nil {
		commhttp.WriteErrorResponse(rw, http.StatusBadRequest, fmt.Sprintf("profile %s already exists", profile.Name))
		return
	}
	profile, err = o.createHolderProfile(request)
	if err != nil {
		commhttp.WriteErrorResponse(rw, http.StatusBadRequest, err.Error())
		return
	}
	err = o.profileStore.SaveHolderProfile(profile)
	if err != nil {
		commhttp.WriteErrorResponse(rw, http.StatusBadRequest, err.Error())
		return
	}
	rw.WriteHeader(http.StatusCreated)
	commhttp.WriteResponse(rw, profile)
}
func (o *Operation) getHolderProfileHandler(rw http.ResponseWriter, req *http.Request) {
	profileID := mux.Vars(req)[profileIDPathParam]
	fmt.Println(profileID)
	profile, err := o.profileStore.GetHolderProfile(profileID)
	if err != nil {
		commhttp.WriteErrorResponse(rw, http.StatusBadRequest, err.Error())
		return
	}
	commhttp.WriteResponse(rw, profile)
}