-
Notifications
You must be signed in to change notification settings - Fork 22
/
curve_get.go
59 lines (45 loc) · 1.17 KB
/
curve_get.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package curve25519
import (
"github.com/deatil/go-cryptobin/dh/curve25519"
cryptobin_tool "github.com/deatil/go-cryptobin/tool"
)
// 获取 PrivateKey
func (this Curve25519) GetPrivateKey() *curve25519.PrivateKey {
return this.privateKey
}
// 获取 X 16进制字符
func (this Curve25519) GetPrivateKeyXHexString() string {
data := this.privateKey.X
dataHex := cryptobin_tool.
NewEncoding().
HexEncode(data)
return dataHex
}
// 获取 PublicKey
func (this Curve25519) GetPublicKey() *curve25519.PublicKey {
return this.publicKey
}
// 获取 Y 16进制字符
func (this Curve25519) GetPublicKeyYHexString() string {
data := this.publicKey.Y
dataHex := cryptobin_tool.
NewEncoding().
HexEncode(data)
return dataHex
}
// 获取 keyData
func (this Curve25519) GetKeyData() []byte {
return this.keyData
}
// 获取 secretData
func (this Curve25519) GetSecretData() []byte {
return this.secretData
}
// 获取错误
func (this Curve25519) GetErrors() []error {
return this.Errors
}
// 获取错误
func (this Curve25519) Error() cryptobin_tool.Errors {
return cryptobin_tool.NewErrors(this.Errors)
}