proof

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 2 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// SignatureProofValue uses "proofValue" field in a Proof to put/read a digital signature.
	SignatureProofValue = ldproof.SignatureProofValue

	// SignatureJWS uses "jws" field in a Proof as an element for representation of detached JSON Web Signatures.
	SignatureJWS = ldproof.SignatureJWS
)

Variables

View Source
var ErrProofNotFound = ldproof.ErrProofNotFound

ErrProofNotFound is returned when proof is not found.

Functions

func AddProof

func AddProof(jsonLdObject map[string]interface{}, proof *Proof) error

AddProof adds a proof to LD Object.

func CreateDetachedJWTHeader added in v0.1.2

func CreateDetachedJWTHeader(alg string) string

CreateDetachedJWTHeader creates detached JWT header.

func CreateVerifyData added in v0.1.2

func CreateVerifyData(suite signatureSuite, jsonldDoc map[string]interface{}, proof *Proof,
	opts ...processor.Opts) ([]byte, error)

CreateVerifyData creates data that is used to generate or verify a digital signature. It depends on the signature value holder type. In case of "proofValue", the standard Create Verify Hash algorithm is used. In case of "jws", verify data is built as JSON Web Signature (JWS) with detached payload.

func CreateVerifyHash

func CreateVerifyHash(suite signatureSuite, jsonldDoc, proofOptions map[string]interface{},
	opts ...processor.Opts) ([]byte, error)

CreateVerifyHash returns data that is used to generate or verify a digital signature Algorithm steps are described here https://w3c-dvcg.github.io/ld-signatures/#create-verify-hash-algorithm

func DecodeProofValue added in v0.1.9

func DecodeProofValue(s, proofType string) ([]byte, error)

DecodeProofValue decodes proofValue basing on proof type.

func EncodeProofValue added in v0.1.9

func EncodeProofValue(proofValue []byte, proofType string) string

EncodeProofValue decodes proofValue basing on proof type.

func GetCopyWithoutProof

func GetCopyWithoutProof(jsonLdObject map[string]interface{}) map[string]interface{}

GetCopyWithoutProof gets copy of JSON LD Object without proofs (signatures).

func GetJWTSignature added in v0.1.2

func GetJWTSignature(jwt string) ([]byte, error)

GetJWTSignature returns signature part of JWT.

Types

type Proof

type Proof = ldproof.Proof

Proof is cryptographic proof of the integrity of the DID Document.

func GetProofs

func GetProofs(jsonLdObject map[string]interface{}) ([]*Proof, error)

GetProofs gets proof(s) from LD Object.

func NewProof

func NewProof(emap map[string]interface{}) (*Proof, error)

NewProof creates new proof.

type SignatureRepresentation added in v0.1.2

type SignatureRepresentation = ldproof.SignatureRepresentation

SignatureRepresentation defines a representation of signature value.

Jump to

Keyboard shortcuts

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