authenticity

package
v2.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SignatureAlgFromProto = map[string]SignatureAlg{
		"ES256K": ECDSA,
		"ENS":    ENS,
		"BJJ":    BJJ,
	}
)

Functions

This section is empty.

Types

type HashAlg added in v2.7.0

type HashAlg int32
const (
	Sha256       HashAlg = iota
	Keccak256    HashAlg = iota
	Poseidon     HashAlg = iota
	None         HashAlg = iota
	Unrecognized HashAlg = -1
)

type Signature

type Signature struct {
	Signature   string
	Alg         string
	Kid         string
	MessageHash string
	Subject     *string
}

func NewSignatureFromProto

func NewSignatureFromProto(s *proto.Signature) Signature

func (*Signature) GetAlg

func (s *Signature) GetAlg() SignatureAlg

func (Signature) ToProto

func (s Signature) ToProto() *proto.Signature

type SignatureAlg

type SignatureAlg int32
const (
	ECDSA                      SignatureAlg = iota
	ENS                        SignatureAlg = iota
	BJJ                        SignatureAlg = iota
	UNRECOGNIZED_SIGNATURE_ALG SignatureAlg = -1
)

type SignatureHeaderJws added in v2.7.0

type SignatureHeaderJws struct {
	Alg string
	Kid string
}

func NewSignatureHeaderJwsFromProto added in v2.7.0

func NewSignatureHeaderJwsFromProto(s *proto.SignatureHeaderJWS) SignatureHeaderJws

func (SignatureHeaderJws) ToProto added in v2.7.0

type SignatureJws added in v2.7.0

type SignatureJws struct {
	Signature   string
	Protected   string
	Header      SignatureHeaderJws
	MessageHash string
}

func NewSignatureJwsFromProto added in v2.7.0

func NewSignatureJwsFromProto(s *proto.SignatureJWS) SignatureJws

func (*SignatureJws) GetAlg added in v2.7.0

func (s *SignatureJws) GetAlg() SignatureAlg

func (SignatureJws) ToProto added in v2.7.0

func (s SignatureJws) ToProto() *proto.SignatureJWS

type Signer

type Signer struct {
	LocalKey           *key.LocalKey
	ManagedKey         *key.ManagedKey
	ManagedCertificate *key.ManagedCertificate
	LocalCertificate   *key.LocalCertificate
	HashAlg            *HashAlg
}

func NewSignerWithLocalCertificate added in v2.7.0

func NewSignerWithLocalCertificate(key key.LocalCertificate, hashAlg *HashAlg) Signer

func NewSignerWithLocalKey added in v2.7.0

func NewSignerWithLocalKey(key key.LocalKey, hashAlg *HashAlg) Signer

func NewSignerWithManagedCertificate added in v2.7.0

func NewSignerWithManagedCertificate(key key.ManagedCertificate, hashAlg *HashAlg) Signer

func NewSignerWithManagedKey added in v2.7.0

func NewSignerWithManagedKey(key key.ManagedKey, hashAlg *HashAlg) Signer

func (Signer) ToProto

func (s Signer) ToProto() *proto.Signer

Jump to

Keyboard shortcuts

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