vcsigner

package
v1.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Ed25519Signature2018 ed25519 signature suite.
	Ed25519Signature2018 = "Ed25519Signature2018"
	// Ed25519Signature2020 ed25519 signature suite.
	Ed25519Signature2020 = "Ed25519Signature2020"
	// JSONWebSignature2020 json web signature suite.
	JSONWebSignature2020 = "JsonWebSignature2020"

	// AssertionMethod assertionMethod.
	AssertionMethod = "assertionMethod"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

Opt represents option for Sign fn.

func WithCreated

func WithCreated(t time.Time) Opt

WithCreated allows providing time when signing credentials.

func WithDomain

func WithDomain(domain string) Opt

WithDomain allows providing domain when signing credentials.

func WithSignatureRepresentation

func WithSignatureRepresentation(signature verifiable.SignatureRepresentation) Opt

WithSignatureRepresentation allows providing signature representation when signing credentials.

type Providers

type Providers struct {
	DocLoader  ld.DocumentLoader
	KeyManager keyManager
	Crypto     crypto
	Metrics    metricsProvider
}

Providers contains all of the providers required by verifiable credential signer.

type Signer

type Signer struct {
	*Providers
	// contains filtered or unexported fields
}

Signer to sign verifiable credential.

func New

func New(providers *Providers, params SigningParams) (*Signer, error)

New returns new instance of VC signer.

func (*Signer) Context added in v1.0.0

func (s *Signer) Context() []string

Context return context.

func (*Signer) Sign

func (s *Signer) Sign(vc *verifiable.Credential, opts ...Opt) (*verifiable.Credential, error)

Sign will sign verifiable credential.

type SigningParams

type SigningParams struct {
	VerificationMethod string
	SignatureSuite     string
	Domain             string
}

SigningParams contains required parameters for signing anchored credential.

Jump to

Keyboard shortcuts

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