-
Notifications
You must be signed in to change notification settings - Fork 171
/
utils.go
31 lines (24 loc) · 1009 Bytes
/
utils.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
package goEncrypt
import "errors"
var (
ErrCipherKey=errors.New("The secret key is wrong and cannot be decrypted. Please check")
ErrKeyLengthSixteen=errors.New("a sixteen or twenty-four or thirty-two length secret key is required")
ErrKeyLengtheEight=errors.New("a eight-length secret key is required")
ErrKeyLengthTwentyFour=errors.New("a twenty-four-length secret key is required")
ErrPaddingSize=errors.New("padding size error please check the secret key or iv")
ErrIvAes=errors.New("a sixteen-length ivaes is required")
ErrIvDes=errors.New("a eight-length ivdes key is required")
ErrRsaBits=errors.New("bits 1024 or 2048")
)
const (
Ivaes="wumansgy12345678"
Ivdes="wumansgy"
privateFileName="private.pem"
publicFileName="public.pem"
eccPrivateFileName="eccprivate.pem"
eccPublishFileName="eccpublic.pem"
privateKeyPrefix=" WUMAN RSA PRIVATE KEY "
publicKeyPrefix=" WUMAN RSA PUBLIC KEY "
eccPrivateKeyPrefix=" WUMAN ECC PRIVATE KEY "
eccPublicKeyPrefix=" WUMAN ECC PUBLIC KEY "
)