crypto

package
v0.0.0-...-7b7c10a Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

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

	// Ed25519VerificationKey2018 ed25119 verification key.
	Ed25519VerificationKey2018 = "Ed25519VerificationKey2018"
	// JSONWebKey2020 type.
	JSONWebKey2020 = "JsonWebKey2020"
)
View Source
const (
	// Ed25519KeyType ed25519 key type.
	Ed25519KeyType = "Ed25519"

	// P256KeyType EC P-256 key type.
	P256KeyType = "P256"
)
View Source
const (

	// AssertionMethod assertionMethod.
	AssertionMethod = "assertionMethod"

	// Authentication authentication.
	Authentication = "authentication"

	// CapabilityDelegation capabilityDelegation.
	CapabilityDelegation = "capabilityDelegation"

	// CapabilityInvocation capabilityInvocation.
	CapabilityInvocation = "capabilityInvocation"
)

Variables

This section is empty.

Functions

func ValidateProofPurpose

func ValidateProofPurpose(proofPurpose, method string, didDoc *did.Doc) error

ValidateProofPurpose validates the proof purpose.

Types

type Crypto

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

Crypto to sign credential.

func New

func New(keyManager kms.KeyManager, c ariescrypto.Crypto, vdr vdrapi.Registry, loader ld.DocumentLoader) *Crypto

New return new instance of vc crypto.

func (*Crypto) SignCredential

func (c *Crypto) SignCredential(dataProfile *vcprofile.DataProfile, vc *verifiable.Credential, opts ...SigningOpts,
) (*verifiable.Credential, error)

SignCredential sign vc.

func (*Crypto) SignPresentation

func (c *Crypto) SignPresentation(profile *vcprofile.HolderProfile, vp *verifiable.Presentation, opts ...SigningOpts,
) (*verifiable.Presentation, error)

SignPresentation signs a presentation.

type SigningOpts

type SigningOpts func(opts *signingOpts)

SigningOpts is signing credential option.

func WithChallenge

func WithChallenge(challenge string) SigningOpts

WithChallenge proof challenge.

func WithCreated

func WithCreated(created *time.Time) SigningOpts

WithCreated is an option to pass created time option for signing.

func WithDomain

func WithDomain(domain string) SigningOpts

WithDomain proof domain.

func WithPurpose

func WithPurpose(purpose string) SigningOpts

WithPurpose is an option to pass proof purpose option for signing.

func WithSignatureType

func WithSignatureType(signatureType string) SigningOpts

WithSignatureType is an option to pass signature type for signing.

func WithSigningRepresentation

func WithSigningRepresentation(representation string) SigningOpts

WithSigningRepresentation is an option to pass representation for signing.

func WithVerificationMethod

func WithVerificationMethod(verificationMethod string) SigningOpts

WithVerificationMethod is an option to pass verification method for signing.

Jump to

Keyboard shortcuts

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