signer

package
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2022 License: Apache-2.0, BSD-3-Clause, MIT, + 1 more Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(vault Vault, supportedKeys []string, httpClient *http.Client, logger *zap.Logger) *Service

func (*Service) CreatePresentation

func (s *Service) CreatePresentation(ctx context.Context, req *signer.CreatePresentationRequest) (interface{}, error)

CreatePresentation creates VP with proof from raw JSON data.

func (*Service) CredentialProof

func (s *Service) CredentialProof(ctx context.Context, req *signer.CredentialProofRequest) (interface{}, error)

CredentialProof adds a proof to a given Verifiable Credential.

func (*Service) NamespaceKeys

func (s *Service) NamespaceKeys(ctx context.Context, req *signer.NamespaceKeysRequest) ([]string, error)

NamespaceKeys returns all keys names for a given namespace.

func (*Service) Namespaces

func (s *Service) Namespaces(ctx context.Context) ([]string, error)

Namespaces returns all keys namespaces, which corresponds to enabled Vault transit engines.

func (*Service) PresentationProof

func (s *Service) PresentationProof(ctx context.Context, req *signer.PresentationProofRequest) (interface{}, error)

PresentationProof adds a proof to a given Verifiable Presentation.

func (*Service) VerificationMethod

VerificationMethod returns a single public key formatted as DID verification method.

func (*Service) VerificationMethods

func (s *Service) VerificationMethods(ctx context.Context, req *signer.VerificationMethodsRequest) (res []*signer.DIDVerificationMethod, err error)

VerificationMethods returns all public keys from Vault or OCM.

func (*Service) VerifyCredential

func (s *Service) VerifyCredential(ctx context.Context, req *signer.VerifyCredentialRequest) (*signer.VerifyResult, error)

VerifyCredential verifies the proof of a Verifiable Credential.

func (*Service) VerifyPresentation

func (s *Service) VerifyPresentation(ctx context.Context, req *signer.VerifyPresentationRequest) (*signer.VerifyResult, error)

VerifyPresentation verifies the proof of a Verifiable Presentation.

type Vault

type Vault interface {
	Namespaces(ctx context.Context) ([]string, error)
	NamespaceKeys(ctx context.Context, namespace string) ([]string, error)
	Key(ctx context.Context, namespace, key string) (*VaultKey, error)
	Keys(ctx context.Context, namespace string) ([]*VaultKey, error)
	Sign(data []byte) ([]byte, error)
	WithKey(namespace, key string) Vault
}

type VaultKey

type VaultKey struct {
	Name      string `json:"name"`
	Type      string `json:"type"`
	PublicKey string `json:"public_key,omitempty"`
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL