keys

package
v0.0.0-...-e5f1a90 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const BITSIZE = 2048

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyHandler

type KeyHandler interface {
	// Export the private key in PEM form to the given path
	Export(path string) error

	// Sign the given data and return the signature and the digest
	Sign(data []byte) (signature []byte, digest []byte, signErr error)

	// Verify the signature of the given checksum
	Verify(checksum []byte, signature []byte) error
}

func Generate

func Generate() (KeyHandler, error)

Generate a new RSA key pair

func Import

func Import(path string, keyType string) (KeyHandler, error)

Import a RSA Private key (PEM) from the given path

type RSA

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

func (*RSA) Export

func (r *RSA) Export(path string) error

func (*RSA) Sign

func (r *RSA) Sign(d []byte) ([]byte, []byte, error)

func (*RSA) Verify

func (r *RSA) Verify(sum []byte, sig []byte) error

Jump to

Keyboard shortcuts

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