signer

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 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, verifiers []Verifier, supportedKeys []string, docLoader *ld.CachingDocumentLoader, logger *zap.Logger) *Service

func (*Service) CreateCredential

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

CreateCredential creates Verifiable Credential with proof from raw JSON data.

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) JwkPublicKey

func (s *Service) JwkPublicKey(ctx context.Context, req *signer.JwkPublicKeyRequest) (any, error)

JwkPublicKey returns public key by name and namespace.

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) Sign

func (s *Service) Sign(_ context.Context, req *signer.SignRequest) (res *signer.SignResult, err error)

Sign creates digital signature on base64 encoded binary data.

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
	Alg() string
}

type VaultKey

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

type Verifier added in v1.1.2

type Verifier interface {
	VerifyCredential(ctx context.Context, vc *verifiable.Credential) error
	VerifyPresentation(ctx context.Context, vp *verifiable.Presentation) error
}

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