crypto

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Ed25519Signature2018 ed25519 signature suite
	Ed25519Signature2018 = "Ed25519Signature2018"

	// Ed25519VerificationKey2018 ed25119 verification key
	Ed25519VerificationKey2018 = "Ed25519VerificationKey2018"
)
View Source
const (

	// AssertionMethod assertionMethod
	AssertionMethod = "assertionMethod"

	// Authentication authentication
	Authentication = "authentication"
)

Variables

This section is empty.

Functions

func GetDIDFromVerificationMethod

func GetDIDFromVerificationMethod(method string) (string, error)

GetDIDFromVerificationMethod fetches did from the verification method.

func GetKeyIDFromVerificationMethod

func GetKeyIDFromVerificationMethod(creator string) (string, error)

GetKeyIDFromVerificationMethod fetches keyid from the verification method.

func GetVerificationMethodFromDID

func GetVerificationMethodFromDID(d *did.Doc, rel did.VerificationRelationship) (string, error)

GetVerificationMethodFromDID returns the first verification method found with the given relationship.

Types

type Crypto

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

Crypto vc crypto.

func New

func New(keyManager kms.KeyManager, c ariescrypto.Crypto, vdri vdriapi.Registry, dl ld.DocumentLoader) *Crypto

New returns new instance of vc crypto.

func (*Crypto) SignCredential

func (c *Crypto) SignCredential(vc *verifiable.Credential, signingKeyID string) (*verifiable.Credential, error)

SignCredential signs a credential.

func (*Crypto) SignPresentation

func (c *Crypto) SignPresentation(vp *verifiable.Presentation, signingKeyID string) (*verifiable.Presentation, error)

SignPresentation signs a presentation. TODO should inject jsonld document loader: https://github.com/trustbloc/edge-adapter/issues/306

Jump to

Keyboard shortcuts

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