vcsigner

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

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"

	// CtxJWS is the JWS context.
	CtxJWS = "https://w3id.org/security/suites/jws-2020/v1"
	// CtxEd25519Signature2018 is the ED25519-2018 context.
	CtxEd25519Signature2018 = "https://w3id.org/security/suites/ed25519-2018/v1"
	// CtxEd25519Signature2020 is the ED25519-2020 context.
	CtxEd25519Signature2020 = "https://w3id.org/security/suites/ed25519-2020/v1"

	// 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

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