algorithm

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Algorithm

type Algorithm interface {
	Sign(algorithm SignatureAlgorithm, digest []byte) (SignResult, error)
	Verify(algorithm SignatureAlgorithm, digest, signature []byte) (VerifyResult, error)
}

func Wrap

func Wrap(key azkeys.JSONWebKey) (Algorithm, error)

type ECDsa

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

func (ECDsa) Sign

func (c ECDsa) Sign(algorithm SignatureAlgorithm, digest []byte) (SignResult, error)

func (ECDsa) Verify

func (c ECDsa) Verify(algorithm SignatureAlgorithm, digest, signature []byte) (VerifyResult, error)

type SignResult

type SignResult struct {
	// Algorithm is algorithm used to sign.
	Algorithm SignatureAlgorithm

	// KeyID is the key ID used to sign. This key ID should be retained.
	KeyID string

	// Signature is a signed hash of the data.
	Signature []byte
}

type SignatureAlgorithm

type SignatureAlgorithm = azkeys.JSONWebKeySignatureAlgorithm

type VerifyResult

type VerifyResult struct {
	// Algorithm is algorithm used to verify.
	Algorithm SignatureAlgorithm

	// KeyID is the key ID used to verify.
	KeyID string

	// Valid is true of the signature is valid.
	Valid bool
}

Jump to

Keyboard shortcuts

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