crypto

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DigestJSON

func DigestJSON(payload any) ([]byte, error)

DigestJSON generates a SHA-256 hash of the canonicalized input payload.

func Sign

func Sign(digester Digester, bearerDID did.BearerDID) (string, error)

Sign signs a resource with a given bearerDID

func VerifyDigest

func VerifyDigest(expectedDigest string, payload any) error

VerifyDigest verifies that the digest of a given payload matches the expected digest.

func VerifySignature

func VerifySignature(digester Digester, signature string) (*jws.Decoded, error)

VerifySignature verifies the given signature and the signed payload

Types

type Digester

type Digester interface {
	Digest() ([]byte, error)
}

Digester is an interface for resources that can be digested

Jump to

Keyboard shortcuts

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