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 ¶
- Variables
- type SignatureSuite
- func (s *SignatureSuite) Accept(t string) bool
- func (s *SignatureSuite) GetCanonicalDocument(doc map[string]interface{}) ([]byte, error)
- func (s *SignatureSuite) GetDigest(doc []byte) []byte
- func (s *SignatureSuite) Sign(data []byte) ([]byte, error)
- func (s *SignatureSuite) Verify(pubKey, doc, signature []byte) error
- type SuiteOpt
Constants ¶
This section is empty.
Variables ¶
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 (*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.