Documentation ¶
Index ¶
- Variables
- func ComputeSecret(private *PrivateKey, peersPublic *PublicKey) (secret []byte)
- func GenerateKey(curve elliptic.Curve, rand io.Reader) (*PrivateKey, *PublicKey, error)
- func MarshalPrivateKey(key *PrivateKey) ([]byte, error)
- func MarshalPublicKey(key *PublicKey) ([]byte, error)
- type Curve
- type PrivateKey
- type PublicKey
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ComputeSecret ¶
func ComputeSecret(private *PrivateKey, peersPublic *PublicKey) (secret []byte)
生成密码
func GenerateKey ¶
生成密钥对
Types ¶
type PrivateKey ¶
私钥
func (*PrivateKey) ComputeSecret ¶ added in v1.0.1025
func (this *PrivateKey) ComputeSecret(peersPublic *PublicKey) (secret []byte)
生成密码
func (*PrivateKey) Public ¶
func (this *PrivateKey) Public() crypto.PublicKey
type PublicKey ¶
公钥
func GeneratePublicKey ¶ added in v1.0.1025
func GeneratePublicKey(private *PrivateKey) (*PublicKey, error)
从私钥获取公钥
Click to show internal directories.
Click to hide internal directories.