crypto

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

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

Go to latest
Published: Jul 31, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyType       = "Ed25519VerificationKey2018"
	SignatureType = "Ed25519Signature2018"
)

Variables

This section is empty.

Functions

func Canonicalize

func Canonicalize(input []byte) ([]byte, error)

func GenerateProof

func GenerateProof(input []byte, key ed25519.PrivateKey, didTwit string) (*pkg.Proof, error)

GenerateProof takes in an unsigned document in byte array form, canonicalizes it, and appends a proof value with a nonce before signing the combination. The signature is added to the proof value, and the proof with signature is returned. This is in compliance with the Ed25519 2018 Linked Data Signature Suite.

func VerifyProof

func VerifyProof(input []byte, key ed25519.PublicKey, proof pkg.Proof) error

VerifyProof takes in an unsigned document in byte array form, canonicalizes it, and appends the provided proof value without the signature value set. Then the proof without signature is appended to the input. The result is verified using the provided public lib value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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