-
Notifications
You must be signed in to change notification settings - Fork 21
/
config.go
58 lines (49 loc) · 894 Bytes
/
config.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
package crypto
import (
"github.com/deatil/go-cryptobin/tool"
)
/**
* 配置 / Config
*
* @create 2023-3-30
* @author deatil
*/
type Config struct {
crypto Cryptobin
}
// New Config
func NewConfig(c Cryptobin) Config {
return Config{
crypto: c,
}
}
// 获取密钥
// get Key
func (this Config) Key() []byte {
return this.crypto.key
}
// 获取向量
// get Iv
func (this Config) Iv() []byte {
return this.crypto.iv
}
// 获取加密类型
// get Multiple
func (this Config) Multiple() Multiple {
return this.crypto.multiple
}
// 获取加密模式
// get Mode
func (this Config) Mode() Mode {
return this.crypto.mode
}
// 获取补码
// get Padding
func (this Config) Padding() Padding {
return this.crypto.padding
}
// 获取额外配置
// get extra Config
func (this Config) Config() *tool.Config {
return this.crypto.config
}