func (o *Operation) GeneratePresentationByID(rw http.ResponseWriter, req *http.Request) {
	rest.Execute(o.command.GeneratePresentationByID, rw, req.Body)
}
GeneratePresentationByID swagger:route POST /verifiable/presentation/generatebyid verifiable generatePresentationByIDReq

Generates the verifiable presentation from a stored verifiable credential.

Responses:
default: genericError
200: presentationRes
package verifiable
import (
	"bytes"
	"encoding/base64"
	"fmt"
	"net/http"
	"github.com/gorilla/mux"
	"github.com/piprate/json-gold/ld"
	"github.com/hyperledger/aries-framework-go/pkg/controller/command/verifiable"
	"github.com/hyperledger/aries-framework-go/pkg/controller/internal/cmdutil"
	"github.com/hyperledger/aries-framework-go/pkg/controller/rest"
	ariescrypto "github.com/hyperledger/aries-framework-go/pkg/crypto"
	"github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr"
	"github.com/hyperledger/aries-framework-go/pkg/kms"
	"github.com/hyperledger/aries-framework-go/spi/storage"
)
const (
	VerifiableOperationID      = "/verifiable"
	verifiableCredentialPath   = VerifiableOperationID + "/credential"
	verifiablePresentationPath = VerifiableOperationID + "/presentation"
	ValidateCredentialPath     = verifiableCredentialPath + "/validate"
	SaveCredentialPath         = verifiableCredentialPath
	GetCredentialPath          = verifiableCredentialPath + "/{id}"
	GetCredentialByNamePath    = verifiableCredentialPath + "/name" + "/{name}"
	GetCredentialsPath         = VerifiableOperationID + "/credentials"
	SignCredentialsPath        = VerifiableOperationID + "/signcredential"
	DeriveCredentialPath       = VerifiableOperationID + "/derivecredential"
	RemoveCredentialByNamePath = verifiableCredentialPath + "/remove/name" + "/{name}"
	GeneratePresentationPath     = verifiablePresentationPath + "/generate"
	GeneratePresentationByIDPath = verifiablePresentationPath + "/generatebyid"
	SavePresentationPath         = verifiablePresentationPath
	GetPresentationPath          = verifiablePresentationPath + "/{id}"
	GetPresentationsPath         = VerifiableOperationID + "/presentations"
	RemovePresentationByNamePath = verifiablePresentationPath + "/remove/name" + "/{name}"
)
type provider interface {
	StorageProvider() storage.Provider
	VDRegistry() vdr.Registry
	KMS() kms.KeyManager
	Crypto() ariescrypto.Crypto
	JSONLDDocumentLoader() ld.DocumentLoader
}
type Operation struct {
	handlers []rest.Handler
	command  *verifiable.Command
}
func New(p provider) (*Operation, error) {
	cmd, err := verifiable.New(p)
	if err != nil {
		return nil, fmt.Errorf("verfiable new: %w", err)
	}
	o := &Operation{command: cmd}
	o.registerHandler()
	return o, nil
}
func (o *Operation) GetRESTHandlers() []rest.Handler {
	return o.handlers
}
func (o *Operation) registerHandler() {
	o.handlers = []rest.Handler{
		cmdutil.NewHTTPHandler(ValidateCredentialPath, http.MethodPost, o.ValidateCredential),
		cmdutil.NewHTTPHandler(SaveCredentialPath, http.MethodPost, o.SaveCredential),
		cmdutil.NewHTTPHandler(GetCredentialPath, http.MethodGet, o.GetCredential),
		cmdutil.NewHTTPHandler(GetCredentialByNamePath, http.MethodGet, o.GetCredentialByName),
		cmdutil.NewHTTPHandler(GetCredentialsPath, http.MethodGet, o.GetCredentials),
		cmdutil.NewHTTPHandler(SignCredentialsPath, http.MethodPost, o.SignCredential),
		cmdutil.NewHTTPHandler(DeriveCredentialPath, http.MethodPost, o.DeriveCredential),
		cmdutil.NewHTTPHandler(GeneratePresentationPath, http.MethodPost, o.GeneratePresentation),
		cmdutil.NewHTTPHandler(GeneratePresentationByIDPath, http.MethodPost, o.GeneratePresentationByID),
		cmdutil.NewHTTPHandler(SavePresentationPath, http.MethodPost, o.SavePresentation),
		cmdutil.NewHTTPHandler(GetPresentationPath, http.MethodGet, o.GetPresentation),
		cmdutil.NewHTTPHandler(GetPresentationsPath, http.MethodGet, o.GetPresentations),
		cmdutil.NewHTTPHandler(RemoveCredentialByNamePath, http.MethodPost, o.RemoveCredentialByName),
		cmdutil.NewHTTPHandler(RemovePresentationByNamePath, http.MethodPost, o.RemovePresentationByName),
	}
}
func (o *Operation) ValidateCredential(rw http.ResponseWriter, req *http.Request) {
	rest.Execute(o.command.ValidateCredential, rw, req.Body)
}
func (o *Operation) SaveCredential(rw http.ResponseWriter, req *http.Request) {
	rest.Execute(o.command.SaveCredential, rw, req.Body)
}
func (o *Operation) SavePresentation(rw http.ResponseWriter, req *http.Request) {
	rest.Execute(o.command.SavePresentation, rw, req.Body)
}
func (o *Operation) GetCredential(rw http.ResponseWriter, req *http.Request) {
	id := mux.Vars(req)["id"]
	decodedID, err := base64.StdEncoding.DecodeString(id)
	if err != nil {
		rest.SendHTTPStatusError(rw, http.StatusBadRequest, verifiable.InvalidRequestErrorCode, err)
		return
	}
	request := fmt.Sprintf(`{"id":"%s"}`, string(decodedID))
	rest.Execute(o.command.GetCredential, rw, bytes.NewBufferString(request))
}
func (o *Operation) GetPresentation(rw http.ResponseWriter, req *http.Request) {
	id := mux.Vars(req)["id"]
	decodedID, err := base64.StdEncoding.DecodeString(id)
	if err != nil {
		rest.SendHTTPStatusError(rw, http.StatusBadRequest, verifiable.InvalidRequestErrorCode, err)
		return
	}
	request := fmt.Sprintf(`{"id":"%s"}`, string(decodedID))
	rest.Execute(o.command.GetPresentation, rw, bytes.NewBufferString(request))
}
func (o *Operation) GetCredentialByName(rw http.ResponseWriter, req *http.Request) {
	name := mux.Vars(req)["name"]
	request := fmt.Sprintf(`{"name":"%s"}`, name)
	rest.Execute(o.command.GetCredentialByName, rw, bytes.NewBufferString(request))
}
func (o *Operation) GetCredentials(rw http.ResponseWriter, req *http.Request) {
	rest.Execute(o.command.GetCredentials, rw, req.Body)
}
func (o *Operation) SignCredential(rw http.ResponseWriter, req *http.Request) {
	rest.Execute(o.command.SignCredential, rw, req.Body)
}
func (o *Operation) DeriveCredential(rw http.ResponseWriter, req *http.Request) {
	rest.Execute(o.command.DeriveCredential, rw, req.Body)
}
func (o *Operation) GetPresentations(rw http.ResponseWriter, req *http.Request) {
	rest.Execute(o.command.GetPresentations, rw, req.Body)
}
func (o *Operation) GeneratePresentation(rw http.ResponseWriter, req *http.Request) {
	rest.Execute(o.command.GeneratePresentation, rw, req.Body)
}