creator

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt func(c *ProofCreator)

Opt represent ProofCreator creation options.

func WithJWTAlg

func WithJWTAlg(proofDesc proofdesc.JWTProofDescriptor, cryptographicSigner cryptographicSigner) Opt

WithJWTAlg option to set supported jwt alg.

func WithLDProofType

func WithLDProofType(proofDesc proofdesc.LDProofDescriptor, cryptographicSigner cryptographicSigner) Opt

WithLDProofType option to set supported ld proof.

type ProofCreator

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

ProofCreator incapsulate logic of proof creation.

func New

func New(opts ...Opt) *ProofCreator

New creates ProofCreator.

func (*ProofCreator) CreateJWTHeaders

func (c *ProofCreator) CreateJWTHeaders(params jwt.SignParameters) (jose.Headers, error)

CreateJWTHeaders creates correct jwt headers.

func (*ProofCreator) GetLDPCanonicalDocument

func (c *ProofCreator) GetLDPCanonicalDocument(proof *proof.Proof,
	doc map[string]interface{}, opts ...processor.Opts) ([]byte, error)

GetLDPCanonicalDocument will return normalized/canonical version of the document.

func (*ProofCreator) GetLDPDigest

func (c *ProofCreator) GetLDPDigest(proof *proof.Proof, doc []byte) ([]byte, error)

GetLDPDigest returns document digest.

func (*ProofCreator) LDPJWTAlg

func (c *ProofCreator) LDPJWTAlg(proof *proof.Proof, keyType kms.KeyType) (string, error)

LDPJWTAlg will return algorithm for jws signature.

func (*ProofCreator) SignCWT added in v1.1.1

func (c *ProofCreator) SignCWT(params cwt.SignParameters, cborData []byte) ([]byte, error)

SignCWT will sign document and return signature.

func (*ProofCreator) SignJWT

func (c *ProofCreator) SignJWT(params jwt.SignParameters, data []byte) ([]byte, error)

SignJWT will sign document and return signature.

func (*ProofCreator) SignLinkedDocument

func (c *ProofCreator) SignLinkedDocument(proof *proof.Proof, keyType kms.KeyType, doc []byte) ([]byte, error)

SignLinkedDocument will sign document and return signature.

Jump to

Keyboard shortcuts

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