Documentation ¶
Index ¶
- Constants
- type CryptoDH
- func (dh *CryptoDH) GetCurve25519KeyPair() (pri, pub [32]byte)
- func (dh *CryptoDH) GetCurve25519KeyPairBase64() (priBase64, pubBase64 string)
- func (dh *CryptoDH) GetPrivateKey() [32]byte
- func (dh *CryptoDH) GetPrivateKeyBase64() string
- func (dh *CryptoDH) GetPublicKey() [32]byte
- func (dh *CryptoDH) GetPublicKeyBase64() string
- func (dh *CryptoDH) GetShareKey() [32]byte
- func (dh *CryptoDH) GetShareKeyBase64() string
- func (dh *CryptoDH) ScalarMult(pub [32]byte) [32]byte
- func (dh *CryptoDH) ScalarMultBase64(base string) string
Constants ¶
View Source
const (
CRYPTO_DH_KEY_LENGTH = 32
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CryptoDH ¶
type CryptoDH struct {
// contains filtered or unexported fields
}
func (*CryptoDH) GetCurve25519KeyPair ¶
func (*CryptoDH) GetCurve25519KeyPairBase64 ¶
func (*CryptoDH) GetPrivateKey ¶
func (*CryptoDH) GetPrivateKeyBase64 ¶
func (*CryptoDH) GetPublicKey ¶
func (*CryptoDH) GetPublicKeyBase64 ¶
func (*CryptoDH) GetShareKey ¶
func (*CryptoDH) GetShareKeyBase64 ¶
func (*CryptoDH) ScalarMult ¶
pub 对方的公钥(32字节byte数组) 返回key:自己的私钥+对方公钥经DH算法计算出来的加密KEY
func (*CryptoDH) ScalarMultBase64 ¶
base 对方的公钥(base64编码) 返回key:自己的私钥+对方公钥经DH算法计算出来的加密KEY(base64编码)
Click to show internal directories.
Click to hide internal directories.