Documentation ¶
Index ¶
- Variables
- func DecodePrivate(pemBytes []byte) (privateKey ed25519.PrivateKey, err error)
- func DecodePublic(pemBytes []byte) (publicKey ed25519.PublicKey, err error)
- func EncodePrivate(privateKey ed25519.PrivateKey) (pemBytes []byte, err error)
- func EncodePublic(publicKey ed25519.PublicKey) (pemBytes []byte, err error)
- func GenerateKey() (publicKey ed25519.PublicKey, privateKey ed25519.PrivateKey, err error)
- func GeneratePublicKey(privateKey ed25519.PrivateKey) (publicKey ed25519.PublicKey)
- func ReadPrivateFile(privateKeyFile string) (privateKey ed25519.PrivateKey, err error)
- func ReadPublicFile(publicKeyFile string) (publicKey ed25519.PublicKey, err error)
- func WritePrivateFile(privateKeyFile string, privateKey ed25519.PrivateKey) (err error)
- func WritePublicFile(publicKeyFile string, publicKey ed25519.PublicKey) (err error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DecodePrivate ¶
func DecodePrivate(pemBytes []byte) (privateKey ed25519.PrivateKey, err error)
PKCS8解码一个私钥
func DecodePublic ¶
PKIX解码一个公钥
func EncodePrivate ¶
func EncodePrivate(privateKey ed25519.PrivateKey) (pemBytes []byte, err error)
PKCS8编码一个私钥
func EncodePublic ¶
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 WritePrivateFile ¶
func WritePrivateFile(privateKeyFile string, privateKey ed25519.PrivateKey) (err error)
保存一个私钥到文件
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.