Documentation
¶
Index ¶
- func ComputeSecret(private *PrivateKey, peersPublic *PublicKey) []byte
- func GenerateKey(groupID GroupID, rand io.Reader) (*PrivateKey, *PublicKey, error)
- func GenerateKeyWithGroup(param *Group, rand io.Reader) (*PrivateKey, *PublicKey, error)
- func IsSafePrimeGroup(param *Group, n int) bool
- func MarshalPrivateKey(key *PrivateKey) ([]byte, error)
- func MarshalPublicKey(key *PublicKey) ([]byte, error)
- type Group
- type GroupID
- type Parameters
- type PrivateKey
- type PublicKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
生成证书
func GenerateKeyWithGroup ¶ added in v1.0.1025
生成证书
func IsSafePrimeGroup ¶
Types ¶
type Parameters ¶
公用参数
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 ¶
type PublicKey struct {
Parameters
// 公钥
Y *big.Int
}
公钥
func GeneratePublicKey ¶ added in v1.0.1025
func GeneratePublicKey(private *PrivateKey) (*PublicKey, error)
从私钥获取公钥
Click to show internal directories.
Click to hide internal directories.