ed25519signature2018

package
v0.1.3-0...-617a0de Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package ed25519signature2018 implements the Ed25519Signature2018 signature suite for the Linked Data Signatures [LD-SIGNATURES] specification. It uses the RDF Dataset Normalization Algorithm [RDF-DATASET-NORMALIZATION] to transform the input document into its canonical form. It uses SHA-512 [RFC6234] as the message digest algorithm and Ed25519 [ED25519] as the signature algorithm.

Index

Constants

This section is empty.

Variables

View Source
var ErrSignerNotDefined = errors.New("signer is not defined")

ErrSignerNotDefined is returned when Sign() is called but signer option is not defined.

Functions

This section is empty.

Types

type SignatureSuite

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

SignatureSuite implements ed25519 signature suite

func New

func New(opts ...SuiteOpt) *SignatureSuite

New an instance of ed25519 signature suite

func (*SignatureSuite) Accept

func (s *SignatureSuite) Accept(t string) bool

Accept will accept only ed25519 signature type

func (*SignatureSuite) GetCanonicalDocument

func (s *SignatureSuite) GetCanonicalDocument(doc map[string]interface{}) ([]byte, error)

GetCanonicalDocument will return normalized/canonical version of the document Ed25519Signature2018 signature SignatureSuite uses RDF Dataset Normalization as canonicalization algorithm

func (*SignatureSuite) GetDigest

func (s *SignatureSuite) GetDigest(doc []byte) []byte

GetDigest returns document digest

func (*SignatureSuite) Sign

func (s *SignatureSuite) Sign(data []byte) ([]byte, error)

Sign will sign input data.

func (*SignatureSuite) Verify

func (s *SignatureSuite) Verify(pubKey, doc, signature []byte) error

Verify will verify a signature.

type SuiteOpt

type SuiteOpt func(opts *SignatureSuite)

SuiteOpt is the SignatureSuite option.

func WithSigner

func WithSigner(s signer) SuiteOpt

WithSigner defines a signer for the Signature Suite.

Jump to

Keyboard shortcuts

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