utils

package
v0.0.0-...-dbf2142 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodePrivate

func DecodePrivate(pemEncodedPriv string) (*ecdsa.PrivateKey, error)

DecodePrivate private key

func DecodePublic

func DecodePublic(pemEncodedPub string) (*ecdsa.PublicKey, error)

DecodePublic public key

func EncodePrivate

func EncodePrivate(privKey *ecdsa.PrivateKey) (string, error)

EncodePrivate private key

func EncodePublic

func EncodePublic(pubKey *ecdsa.PublicKey) (string, error)

EncodePublic public key

func GenerateKeys

func GenerateKeys() (*ecdsa.PrivateKey, *ecdsa.PublicKey, error)

GenerateKeys EllipticCurve public and private keys

func IsNotAllowed

func IsNotAllowed(peerId string, wblist model.WhiteOrBlackList) bool

func LoadConfig

func LoadConfig(path string) (*model.Config, *model.FixedConfig, error)

func ReadText

func ReadText(path string) (string, error)

func Sign

func Sign(message []byte, privKey *ecdsa.PrivateKey) (string, error)

func Verify

func Verify(message []byte, sign string, pubKey *ecdsa.PublicKey) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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