Documentation
¶
Index ¶
- Constants
- type CryptoDH
- 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 {
PrivateKey [CRYPTO_DH_KEY_LENGTH]byte //私钥
PublicKey [CRYPTO_DH_KEY_LENGTH]byte //公钥
PublicKeyBase64 string //公钥BASE64字符串
PrivateKeyBase64 string //私钥BASE64字符串
}
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.