Documentation ¶
Index ¶
- func Decrypt(data, privateKey []byte, options ...RsaOption) ([]byte, error)
- func Encrypt(data, publicKey []byte) ([]byte, error)
- func GenerateKeyFiles(bits int, priPath, pubPath string, options ...RsaOption) error
- func GenerateKeys(bits int, options ...RsaOption) (pri []byte, pub []byte, err error)
- type KeyFormat
- type RsaOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKeyFiles ¶ added in v2.0.19
GenerateKeyFiles 生成: 公钥 && 私钥
@param bits 512 ||1024 || 2048 || 3072 || 4096 @param options 可配置: format、password
Types ¶
type RsaOption ¶ added in v2.0.19
type RsaOption func(opts *rsaOptions)
func WithFormat ¶ added in v2.0.19
WithFormat 配置: 密钥格式(私钥)
func WithPassword ¶ added in v2.0.19
WithPassword 配置: 私钥密码(可以为"")
Click to show internal directories.
Click to hide internal directories.