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 IsSafePrimeParameters(param Parameters, 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 IsSafePrimeParameters ¶ added in v1.0.1026
func IsSafePrimeParameters(param Parameters, n int) bool
判断是否为安全数据
Types ¶
type Group ¶
分组数据
func GetMODGroup ¶ added in v1.0.1026
Current minimum recommendation is 2048 bit with id=14.
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.