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 ¶ added in v1.0.1040
func ComputeSecret(private *PrivateKey, peersPublic *PublicKey) (secret []byte)
生成密码
func GenerateKey ¶ added in v1.0.1040
生成密钥对
func MarshalPrivateKey ¶ added in v1.0.1040
func MarshalPrivateKey(key *PrivateKey) ([]byte, error)
包装私钥
func MarshalPublicKey ¶ added in v1.0.1040
包装公钥
Types ¶
type PrivateKey ¶
私钥
func ParsePrivateKey ¶ added in v1.0.1040
func ParsePrivateKey(derBytes []byte) (*PrivateKey, error)
解析私钥
func (*PrivateKey) ComputeSecret ¶ added in v1.0.1040
func (this *PrivateKey) ComputeSecret(peersPublic *PublicKey) (secret []byte)
生成密码
func (*PrivateKey) Public ¶ added in v1.0.1040
func (this *PrivateKey) Public() crypto.PublicKey
type PublicKey ¶
公钥
func GeneratePublicKey ¶ added in v1.0.1040
func GeneratePublicKey(private *PrivateKey) (*PublicKey, error)
从私钥获取公钥
func ParsePublicKey ¶ added in v1.0.1040
解析公钥
Click to show internal directories.
Click to hide internal directories.