jsonwebsignature2020

package
v0.1.6-0...-5c25bcb Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package jsonwebsignature2020 implements the JsonWebSignature2020 signature suite for the Linked Data Signatures specification (https://github.com/transmute-industries/lds-jws2020). It uses the RDF Dataset Normalization Algorithm to transform the input document into its canonical form. It uses SHA-256 [RFC6234] as the message digest algorithm. Supported signature algorithms depend on the signer/verifier provided as options to the New(). According to the suite specification, signer/verifier must support the following algorithms: kty | crvOrSize | alg OKP | Ed25519 | EdDSA EC | secp256k1 | ES256K RSA | 2048 | PS256 EC | P-256 | ES256 EC | P-384 | ES384 EC | P-521 | ES512

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPublicKeyVerifier

func NewPublicKeyVerifier() *verifier.PublicKeyVerifier

NewPublicKeyVerifier creates a signature verifier that verifies a Ed25519 / EC (P-256, P-384, P-521, secp256k1) / RSA signature taking public key bytes and / or JSON Web Key as input. The list of Supported JWS algorithms of JsonWebSignature2020 is defined here: https://github.com/transmute-industries/lds-jws2020#supported-jws-algs

Types

type Suite

type Suite struct {
	suite.SignatureSuite
	// contains filtered or unexported fields
}

Suite implements jsonWebSignature2020 signature suite.

func New

func New(opts ...suite.Opt) *Suite

New an instance of Linked Data Signatures for JWS suite.

func (*Suite) Accept

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

Accept will accept only Linked Data Signatures for JWS.

func (*Suite) GetCanonicalDocument

func (s *Suite) GetCanonicalDocument(doc map[string]interface{}, opts ...jsonld.ProcessorOpts) ([]byte, error)

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

func (*Suite) GetDigest

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

GetDigest returns document digest.

Jump to

Keyboard shortcuts

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