signature

package
v0.0.0-...-982e07a Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package signature implements generation and verification of signatures used by KeyStore to authenticate stored key data.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAlgorithms   = errors.New("no key ring signing algorithms")
	ErrNoSignature    = errors.New("missing key ring signature")
	ErrSignatureError = errors.New("invalid key ring signature")
)

Errors produced by signature verification:

Functions

This section is empty.

Types

type Algorithm

type Algorithm interface {
	AlgorithmOID() encodingASN1.ObjectIdentifier
	Sign(data, context []byte) []byte
	Verify(signature, data, context []byte) bool
}

Algorithm interface defines a particular signing algorithm for Notary. It signs and verifies raw byte data. Each algorithm is identified by an ASN.1 Object Identifier.

type Notary

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

Notary cryptographically signs provided ASN.1 data.

func NewNotary

func NewNotary(algorithms []Algorithm) (*Notary, error)

NewNotary makes a new notary with given encryptor.

func (*Notary) Sign

func (s *Notary) Sign(container *asn1.SignedContainer, context []byte) ([]byte, error)

Sign provided container for given context. Updates signatures in the container and return serialized signed data.

func (*Notary) Verify

func (s *Notary) Verify(data, context []byte) (*asn1.VerifiedContainer, error)

Verify signature on the data in given context. Parse and return the container wrapper. The caller should then parse container.Payload.Data based on the value of container.Payload.ContentType.

Jump to

Keyboard shortcuts

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