Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPriKey = []byte(`-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDYmNqFtu28dXu0WJX1+XaB1oiQXcU4gK/s2fmINkDTusc1fToS
FHviE0csyQtntnPMvXXfmU4DB40Yl8Go2jOICn4U9sqdBy5tB1BgnMe1sai8T4vj
MYbgrT3eZC0lzYU+B1rfhrRaPp+Qfj1qurjOikwmDb3Vd/06qRGb+oJ0aQIDAQAB
AoGBAKiqTvB1RKfO7KfBm/VRb4En6GxTOPMI8vYDv5bceJroBZyXiZLutJGV5YTw
gZsfrwkuOA4IuYEObkdKVZoBYMIOJaLkXXbLhE+Y+K/yWadDsoNwmm0oHvkjLfOr
tfZkSRQqpRUmIvdYFkfuEaW+GIwKORJ4OCiud27axzPMp1JpAkEA9dZ54uqsXkBQ
Zrb+QvLYkKvhAFk7vgm0Vp2lpyOScjtF/qQbOvgc0iYJ+IO4k06/lMlss6Bdve+y
v2u/BDLCKwJBAOGM8bLO60mdlc3GMeN60uOPRpTibNkwIxuRpm+O23L35onoE+NG
q93ViKCf7F0tWdaDu90bTmEskzAtIPkvXbsCQDGlbZoA0Gx8SoBjxjdY+ZlFzLuY
SbNYHF49mf2F9oYxKDKDi6g+APwDiJHyb+z3w0LV5qjj4up/pLZ5mOrNIV8CQD+s
L0tAGLIGd5TIn6rNMJ2nA9Dh/sJtUWvl+StDE/Znv0AtMPgXKkuMjW5y1yISvGrP
c4hevgi2sbKG+uj9kyMCQQCqD5LtvALhDtMcxOaPCZ3IehXSGHR2PU4VXnjrtmdh
Z7dUEVETVZ854VLy4q8wNcPjx/b+67UuciTB0nbKfw5z
-----END RSA PRIVATE KEY-----`)
使用openssl生成密钥 openssl genrsa -out rsa_private_key.pem 1024
View Source
var DefaultPubKey = []byte(`-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYmNqFtu28dXu0WJX1+XaB1oiQ
XcU4gK/s2fmINkDTusc1fToSFHviE0csyQtntnPMvXXfmU4DB40Yl8Go2jOICn4U
9sqdBy5tB1BgnMe1sai8T4vjMYbgrT3eZC0lzYU+B1rfhrRaPp+Qfj1qurjOikwm
Db3Vd/06qRGb+oJ0aQIDAQAB
-----END PUBLIC KEY-----`)
公钥: 根据私钥生成 openssl rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem
Functions ¶
func GetHardwareID ¶ added in v0.7.0
GetHardwareID 获得硬件唯一id,由machine id,物理网卡地址,硬盘序列号拼接后,采用HMAC-SHA1加密 secret: 加密密钥,推荐生成方法: openssl rand -hex 64
Types ¶
Click to show internal directories.
Click to hide internal directories.