bjj

package
v2.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Alg jwa.SignatureAlgorithm = "BJJ"

Alg signature algorithm

Variables

This section is empty.

Functions

func ParseKey

func ParseKey(jwkKey jwk.Key) (*bjj.PublicKey, error)

ParseKey parses jwk key to bjj public key

Types

type GoSigner

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

GoSigner implements crypto.Signer interface

func GoSignerFromPrivHex

func GoSignerFromPrivHex(h string) (*GoSigner, error)

GoSignerFromPrivHex creates GoSigner from hex encoded private key

func (*GoSigner) Public

func (s *GoSigner) Public() crypto.PublicKey

Public returns nil because we don't need it

func (*GoSigner) Sign

func (s *GoSigner) Sign(_ io.Reader, buf []byte, _ crypto.SignerOpts) ([]byte, error)

Sign signs the digest with the private key

type Provider

type Provider struct{}

Provider is a signer and verifier for BJJ

func (*Provider) Algorithm

func (p *Provider) Algorithm() jwa.SignatureAlgorithm

Algorithm returns BJJAlg

func (*Provider) Sign

func (p *Provider) Sign(payload []byte, opts interface{}) ([]byte, error)

Sign signs payload with BJJ private key

func (*Provider) Verify

func (p *Provider) Verify(payload, signature []byte, opts interface{}) error

Verify verifies signature with BJJ public key

Jump to

Keyboard shortcuts

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