signature

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: BSD-2-Clause Imports: 8 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignEddsa

func SignEddsa(signable GenericEccSignable, privKey *ec.PrivateKey) error

SignEddsa takes a GenericEccSignable object, marshals the data intended to be signed with a nonce.

func SignRsa

func SignRsa(signable GenericRsaSignable, privKey *rsa.PrivateKey) error

SignRsa takes a GenericRsaSignable object, marshals the data intended to be signed. It hashes that data and sets it as the signature of that object

func VerifyEddsa

func VerifyEddsa(verifiable GenericEccSignable, pubKey *ec.PublicKey) error

VerifyEddsa takes the signature from the verifiable message and verifies it on the public key. If

func VerifyRsa

func VerifyRsa(verifiable GenericRsaSignable, pubKey *rsa.PublicKey) error

VerifyRsa takes the signature from the verifiable message and verifies it on the public key. If

Types

type GenericEccSignable

type GenericEccSignable interface {
	// GetSig returns the RSA signature.
	// IF none exists, it creates it, adds it to the object, then returns it.
	GetEccSig() *messages.ECCSignature

	// Digest hashes the contents of the message in a repeatable manner
	// using the provided cryptographic hash. It includes the nonce in the hash
	Digest(nonce []byte, h hash.Hash) []byte
}

Interface for our GenericRsaSignable structure, to be used for protobuffs we want to be able to cryptographically sign using an RSA key

type GenericRsaSignable

type GenericRsaSignable interface {
	// GetSig returns the RSA signature.
	// IF none exists, it creates it, adds it to the object, then returns it.
	GetSig() *messages.RSASignature
	// Digest hashes the contents of the message in a repeatable manner
	// using the provided cryptographic hash. It includes the nonce in the hash
	Digest(nonce []byte, h hash.Hash) []byte
}

Interface for our GenericRsaSignable structure, to be used for protobuffs we want to be able to cryptographically sign using an RSA key

Jump to

Keyboard shortcuts

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