dsa

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalPrivateKey

func MarshalPrivateKey(key *PrivateKey) ([]byte, error)

MarshalPrivateKey returns the PEM encoded private key.

func MarshalPublicKey

func MarshalPublicKey(key *PublicKey) ([]byte, error)

MarshalPublicKey returns the PEM encoded public key.

func Sign

func Sign(key *PrivateKey, data []byte) ([]byte, error)

Sign signs the data with the private key.

func Verify

func Verify(key *PublicKey, data, sig []byte) bool

Verify verifies the signature of the data with the public key.

Types

type PrivateKey

type PrivateKey = dsa.PrivateKey

func NewPrivateKey

func NewPrivateKey() (*PrivateKey, error)

NewPrivateKey returns a new private key.

func UnmarshalPrivateKey

func UnmarshalPrivateKey(b []byte) (*PrivateKey, error)

UnmarshalPrivateKey returns a private key from a PEM encoded key.

type PublicKey

type PublicKey = dsa.PublicKey

func Public

func Public(key *PrivateKey) *PublicKey

Public extracts the public key from a private key.

func UnmarshalPublicKey

func UnmarshalPublicKey(b []byte) (*PublicKey, error)

UnmarshalPublicKey returns a public key from a PEM encoded key.

Jump to

Keyboard shortcuts

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