Documentation ¶
Index ¶
- Variables
- func LoadRSAPrivateKey(data []byte) (*rsa.PrivateKey, error)
- func LoadRSAPrivateKeyFile(pemFile string) (*rsa.PrivateKey, error)
- func LoadRSAPublicKey(data []byte) (*rsa.PublicKey, error)
- func LoadRSAPublicKeyFile(pemFile string) (*rsa.PublicKey, error)
- func MaxEncryptSize(pubkey *rsa.PublicKey) int
- type BlockCryptor
- func NewAESCFB(key, iv []byte) BlockCryptor
- func NewCrypt(name string, key, iv []byte) BlockCryptor
- func NewNoneCrypt(key, iv []byte) BlockCryptor
- func NewSM4(key, iv []byte) BlockCryptor
- func NewSalsa20(key, iv []byte) BlockCryptor
- func NewTripleDES(key, iv []byte) BlockCryptor
- func NewTwofish(key, iv []byte) BlockCryptor
- func NewXTEA(key, iv []byte) BlockCryptor
Constants ¶
This section is empty.
Variables ¶
View Source
var RSATestPrivateKey = []byte(`-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQC0wugAtwSpvDgiYKi6GC5390KYQy4bAC2jBO13zVW5aQ83WPUH
yvhXnj1N1xujGHMJyNGwEYA9voxmPxyYn83D4cRMBga/GaJtLzbJwakpFMaEzUtI
q8bCgPSTXtxuUx+spw6G/yl6MxO9O+RhScDrQPmpjvB4Z/u0Dl5tdwJPqQIDAQAB
AoGATEj9NGAIvcFLR2bXjkHqSoK1PiEL8iUvHV9VAHxNs0PdQhRuxG0qRX/oi1M+
vKPy2KxBojagkm46PmRgIyE96rkI94boLKfctuMVsqg22GQDtcvBuSVrYPNfgDLw
1EbzQihFqgxO/QYnuakn7GAE4N9x1R5gAQr7Wy00aekhHkkCQQDlZgzAYAyFtZA4
A6NOGGPVM8/FLYwUZVyb9jh1uXJiOEj1j7p5bJhUrXRRduJ+Z2t4OP993OprTV86
slO/QVkvAkEAybkBY2JIK+nDxdxCEmbMcQRolTL/l/MQayBF0lbOVHb5svDdpWbm
q9Y6PwfVK8jbp8bJWYovDJ2wEQF3d0R+pwJAH+wzmhHDrFe32hOnhhaezeyH3UiZ
Vb1FRe7drIRCBqkOfh2iNYOHL0F0DmIc4rpBmllUNI+pj4UU23Y1cUgGwQJALBhq
+0Siria9iuTo9IjQK+xgyCyLvrV9Y018tcwP8lrHnpwUd3GU/v8nYFvf92BC09wa
a55PRpy5vh3p9YJdhQJBAKtEEaC8EB7ghXvvo1O+MJotd+EqO330JsLTUf0GcsjI
zV/yJu951ELuzMZTfemh6l8stjjDYlRvZVPbjwrZP8g=
-----END RSA PRIVATE KEY-----`)
View Source
var RSATestPublicKey = []byte(`-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC0wugAtwSpvDgiYKi6GC5390KY
Qy4bAC2jBO13zVW5aQ83WPUHyvhXnj1N1xujGHMJyNGwEYA9voxmPxyYn83D4cRM
Bga/GaJtLzbJwakpFMaEzUtIq8bCgPSTXtxuUx+spw6G/yl6MxO9O+RhScDrQPmp
jvB4Z/u0Dl5tdwJPqQIDAQAB
-----END PUBLIC KEY-----`)
Functions ¶
func LoadRSAPrivateKeyFile ¶
func LoadRSAPrivateKeyFile(pemFile string) (*rsa.PrivateKey, error)
Types ¶
type BlockCryptor ¶
type BlockCryptor interface { Key() []byte IV() []byte Encrypt(src []byte) []byte Decrypt(src []byte) []byte }
func NewCrypt ¶
func NewCrypt(name string, key, iv []byte) BlockCryptor
func NewNoneCrypt ¶
func NewNoneCrypt(key, iv []byte) BlockCryptor
func NewSalsa20 ¶
func NewSalsa20(key, iv []byte) BlockCryptor
Source Files ¶
Click to show internal directories.
Click to hide internal directories.