func WithRegistry(registry vdr.Registry) Opt {
	return func(vault *Client) {
		vault.registry = registry
	}
}
WithRegistry allows providing registry.
package vault
import (
	"bytes"
	"crypto/ed25519"
	"encoding/json"
	"errors"
	"fmt"
	"net/http"
	"net/url"
	"strings"
	"time"
	"github.com/google/uuid"
	"github.com/hyperledger/aries-framework-go-ext/component/vdr/orb"
	"github.com/hyperledger/aries-framework-go-ext/component/vdr/sidetree/doc"
	ariescrypto "github.com/hyperledger/aries-framework-go/pkg/crypto"
	"github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto"
	webcrypto "github.com/hyperledger/aries-framework-go/pkg/crypto/webkms"
	ariesdid "github.com/hyperledger/aries-framework-go/pkg/doc/did"
	"github.com/hyperledger/aries-framework-go/pkg/doc/jose"
	"github.com/hyperledger/aries-framework-go/pkg/doc/jose/jwk/jwksupport"
	"github.com/hyperledger/aries-framework-go/pkg/doc/signature/jsonld"
	"github.com/hyperledger/aries-framework-go/pkg/doc/signature/suite"
	"github.com/hyperledger/aries-framework-go/pkg/doc/signature/suite/ed25519signature2018"
	"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/pkg/kms/webkms"
	ariesvdr "github.com/hyperledger/aries-framework-go/pkg/vdr"
	"github.com/hyperledger/aries-framework-go/pkg/vdr/fingerprint"
	vdrkey "github.com/hyperledger/aries-framework-go/pkg/vdr/key"
	"github.com/hyperledger/aries-framework-go/spi/storage"
	"github.com/igor-pavlenko/httpsignatures-go"
	"github.com/piprate/json-gold/ld"
	"github.com/trustbloc/edge-core/pkg/zcapld"
	edv "github.com/trustbloc/edv/pkg/client"
	"github.com/trustbloc/edv/pkg/edvutils"
	"github.com/trustbloc/edv/pkg/restapi/messages"
	"github.com/trustbloc/edv/pkg/restapi/models"
	"github.com/trustbloc/kms/pkg/restapi/kms/operation"
	"github.com/trustbloc/edge-service/pkg/doc/vc/crypto"
)
const (
	storeName = "vault"
	authorizationFormat = "authorization_%s_%s"
	metaDocInfoFormat   = "meta_doc_info_%s_%s"
	infoFormat          = "info_%s"
)
type Vault interface {
	CreateVault() (*CreatedVault, error)
	SaveDoc(vaultID, id string, content []byte) (*DocumentMetadata, error)
	GetDocMetadata(vaultID, docID string) (*DocumentMetadata, error)
	CreateAuthorization(vaultID, requestingParty string, scope *AuthorizationsScope) (*CreatedAuthorization, error)
	GetAuthorization(vaultID, id string) (*CreatedAuthorization, error)
}
type KeyManager kms.KeyManager
type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}
type CreatedVault struct {
	ID string `json:"id"`
	*Authorization
}
type CreatedAuthorization struct {
	ID              string               `json:"id"`
	Scope           *AuthorizationsScope `json:"scope"`
	RequestingParty string               `json:"requestingParty"`
	Tokens          *Tokens              `json:"authTokens"`
}
type Tokens struct {
	EDV string `json:"edv"`
	KMS string `json:"kms"`
}
type AuthorizationsScope struct {
	Target     string   `json:"target,omitempty"`
	TargetAttr string   `json:"targetAttr,omitempty"`
	Actions    []string `json:"actions,omitempty"`
	Caveats    []Caveat `json:"caveats,omitempty"`
}
type Caveat struct {
	Type     string `json:"type,omitempty"`
	Duration uint64 `json:"duration,omitempty"`
}
type Authorization struct {
	EDV *Location `json:"edv"`
	KMS *Location `json:"kms"`
}
type Location struct {
	URI       string `json:"uri"`
	AuthToken string `json:"authToken"`
}
type DocumentMetadata struct {
	ID        string `json:"docID"`
	URI       string `json:"edvDocURI"`
	EncKeyURI string `json:"encKeyURI"`
}
type Client struct {
	remoteKMSURL    string
	edvHost         string
	edvScheme       string
	didMethod       string
	didDomain       string
	didAnchorOrigin string
	kms             KeyManager
	crypto          ariescrypto.Crypto
	edvClient       *edv.Client
	httpClient      HTTPClient
	store           storage.Store
	registry        vdr.Registry
	documentLoader  ld.DocumentLoader
}
type Opt func(*Client)
func WithHTTPClient(client HTTPClient) Opt {
	return func(vault *Client) {
		vault.httpClient = client
	}
}
func WithDidMethod(method string) Opt {
	return func(vault *Client) {
		vault.didMethod = method
	}
}
func WithDidDomain(domain string) Opt {
	return func(vault *Client) {
		vault.didDomain = domain
	}
}
func WithDidAnchorOrigin(anchorOrigin string) Opt {
	return func(vault *Client) {
		vault.didAnchorOrigin = anchorOrigin
	}
}