-
Notifications
You must be signed in to change notification settings - Fork 22
/
get.go
64 lines (50 loc) · 1.09 KB
/
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
60
61
62
63
64
package rsa
import (
"crypto"
"crypto/rsa"
cryptobin_tool "github.com/deatil/go-cryptobin/tool"
)
// 获取 PrivateKey
func (this Rsa) GetPrivateKey() *rsa.PrivateKey {
return this.privateKey
}
// 获取 PublicKey
func (this Rsa) GetPublicKey() *rsa.PublicKey {
return this.publicKey
}
// 获取 PublicKeyN
func (this Rsa) GetPublicKeyNHexString() string {
data := this.publicKey.N
dataHex := cryptobin_tool.
NewEncoding().
HexEncode(data.Bytes())
return dataHex
}
// 获取 PublicKeyE
func (this Rsa) GetPublicKeyE() int {
return this.publicKey.E
}
// 获取 hash 类型
func (this Rsa) GetSignHash() crypto.Hash {
return this.signHash
}
// 获取 keyData
func (this Rsa) GetKeyData() []byte {
return this.keyData
}
// 获取 data
func (this Rsa) GetData() []byte {
return this.data
}
// 获取 paredData
func (this Rsa) GetParedData() []byte {
return this.paredData
}
// 获取验证后情况
func (this Rsa) GetVerify() bool {
return this.verify
}
// 获取错误
func (this Rsa) GetErrors() []error {
return this.Errors
}