sign

package
v0.0.0-...-29191c4 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SignatureAlgorithm_ECDSA = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"
View Source
var SignatureAlgorithm_RSA = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"

Functions

func Canon

func Canon(in interface{}) ([]byte, error)

Types

type SignChecker

type SignChecker interface {
	Check(interface{}, []byte) error
}

SignChecker is the interface allowing the verification of a signature

func NewSignChecker

func NewSignChecker(certData []byte, certType string) (SignChecker, error)

NewSignChecker creates a new signature checker, which depends on the certificate type (RSA or ECDSA)

type Signature

type Signature struct {
	Certificate []byte `json:"certificate"`
	Value       []byte `json:"value"`
	Algorithm   string `json:"algorithm"`
}

type Signer

type Signer interface {
	Sign(interface{}) (Signature, error)
}

func NewSigner

func NewSigner(cert *tls.Certificate) (Signer, error)

Creates a new signer, which depends on the certificate type. Currently supports RSA (PKCS1v15) and ECDSA (SHA256 is used in both cases)

Jump to

Keyboard shortcuts

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