eddsa

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyMustBePEMEncoded = errors.New("invalid key: Key must be a PEM encoded PKCS1 or PKCS8 key")
	ErrNotEdPrivateKey     = errors.New("key is not a valid Ed25519 private key")
	ErrNotEdPublicKey      = errors.New("key is not a valid Ed25519 public key")
)

Functions

func DecodePrivate

func DecodePrivate(pemBytes []byte) (privateKey ed25519.PrivateKey, err error)

PKCS8解码一个私钥

func DecodePublic

func DecodePublic(pemBytes []byte) (publicKey ed25519.PublicKey, err error)

PKIX解码一个公钥

func EncodePrivate

func EncodePrivate(privateKey ed25519.PrivateKey) (pemBytes []byte, err error)

PKCS8编码一个私钥

func EncodePublic

func EncodePublic(publicKey ed25519.PublicKey) (pemBytes []byte, err error)

PKIX编码一个公钥

func GenerateKey

func GenerateKey() (publicKey ed25519.PublicKey, privateKey ed25519.PrivateKey, err error)

生成一对密钥对

func GeneratePublicKey

func GeneratePublicKey(privateKey ed25519.PrivateKey) (publicKey ed25519.PublicKey)

func ReadPrivateFile

func ReadPrivateFile(privateKeyFile string) (privateKey ed25519.PrivateKey, err error)

加载一个私钥到文件

func ReadPublicFile

func ReadPublicFile(publicKeyFile string) (publicKey ed25519.PublicKey, err error)

加载一个公钥到文件

func WritePrivateFile

func WritePrivateFile(privateKeyFile string, privateKey ed25519.PrivateKey) (err error)

保存一个私钥到文件

func WritePublicFile

func WritePublicFile(publicKeyFile string, publicKey ed25519.PublicKey) (err error)

保存一个公钥到文件

Types

This section is empty.

Jump to

Keyboard shortcuts

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