-
Notifications
You must be signed in to change notification settings - Fork 21
/
key_setting.go
44 lines (40 loc) · 1.07 KB
/
key_setting.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
package jceks
import (
"crypto/dsa"
"crypto/rsa"
"crypto/ecdsa"
"crypto/ed25519"
"github.com/deatil/go-cryptobin/gm/sm2"
)
func init() {
AddKey(GetStructName(&dsa.PrivateKey{}), func() Key {
return new(KeyDSA)
})
AddKey(GetStructName(&rsa.PrivateKey{}), func() Key {
return new(KeyRsa)
})
AddKey(GetStructName(&ecdsa.PrivateKey{}), func() Key {
return new(KeyEcdsa)
})
AddKey(GetStructName(ed25519.PrivateKey{}), func() Key {
return new(KeyEdDSA)
})
AddKey(GetStructName(&sm2.PrivateKey{}), func() Key {
return new(KeySM2)
})
AddKey(GetStructName(&dsa.PublicKey{}), func() Key {
return new(KeyDSA)
})
AddKey(GetStructName(&rsa.PublicKey{}), func() Key {
return new(KeyRsa)
})
AddKey(GetStructName(&ecdsa.PublicKey{}), func() Key {
return new(KeyEcdsa)
})
AddKey(GetStructName(ed25519.PublicKey{}), func() Key {
return new(KeyEdDSA)
})
AddKey(GetStructName(&sm2.PublicKey{}), func() Key {
return new(KeySM2)
})
}