signing

package
v0.0.0-...-8f6474b Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SportstalkPrivateKey = "SPORTSTALK PRIVATE KEY"
	SportstalkPublicKey  = "SPORTSTALK PUBLIC KEY"
)

Variables

View Source
var (
	ErrInvalidPublicKey = fmt.Errorf("invalid public key")
)

Functions

func ConvertToPemBlock

func ConvertToPemBlock(data []byte, blockType string) *pem.Block

func EnsureDirectoryExists

func EnsureDirectoryExists(dir string) error

func GenerateAndSaveRSAPair

func GenerateAndSaveRSAPair(dir string, filename string) (*rsa.PrivateKey, error)

func GenerateRSAPair

func GenerateRSAPair() (*rsa.PrivateKey, error)

func HashPublicKey

func HashPublicKey(public interface{}) (string, error)

func LoadPrivateKey

func LoadPrivateKey(filename string) (*rsa.PrivateKey, error)

func LoadPublicKey

func LoadPublicKey(filename string) (*rsa.PublicKey, error)

func MarshalPrivateKey

func MarshalPrivateKey(private *rsa.PrivateKey) []byte

func MarshalPublicKey

func MarshalPublicKey(public *rsa.PublicKey) ([]byte, error)

func ParsePrivateKey

func ParsePrivateKey(data string) (*rsa.PrivateKey, error)

func ParsePublicKey

func ParsePublicKey(data string) (*rsa.PublicKey, error)

func RestorePrivateKeyFromPemDate

func RestorePrivateKeyFromPemDate(data []byte) (*rsa.PrivateKey, error)

func RestorePublicKeyFromPemData

func RestorePublicKeyFromPemData(data []byte) (*rsa.PublicKey, error)

func SavePrivateKey

func SavePrivateKey(private *rsa.PrivateKey, dir string, filename string) error

func SavePublicKey

func SavePublicKey(public *rsa.PublicKey, dir string, filename string) error

func SignMessage

func SignMessage(private *rsa.PrivateKey, message interface{}) (string, error)

func StringifyPrivateKey

func StringifyPrivateKey(private *rsa.PrivateKey) string

func StringifyPublicKey

func StringifyPublicKey(public *rsa.PublicKey) (string, error)

func VerifySignature

func VerifySignature(public interface{}, message interface{}, signature string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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