Documentation ¶
Index ¶
- func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) ([]byte, error)
- func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) ([]byte, error)
- func GetBufferPool() *bytes.Buffer
- func GetStringsBuilder() *strings.Builder
- func GetUrlValues() url.Values
- func JSONMarshal(req interface{}) []byte
- func ParsePrivateKeyFromPem(bs []byte) (*rsa.PrivateKey, error)
- func ParsePublicKeyFromPem(bs []byte) (*rsa.PublicKey, error)
- func PutBufferPool(buf *bytes.Buffer)
- func PutStringsBuilder(b *strings.Builder)
- func PutUrlValues(vals url.Values)
- func ReadPrivateKeyFromPem(r io.Reader) (*rsa.PrivateKey, error)
- func ReadPublicKeyFromPem(r io.Reader) (*rsa.PublicKey, error)
- func SignWithPrivateKey(msg []byte, privKey *rsa.PrivateKey) ([]byte, error)
- func StringsJoin(strs ...string) string
- func VerifyWithPublicKey(msg []byte, signature []byte, pubKey *rsa.PublicKey) error
- func WritePrivateKeyPem(w io.Writer, privKey *rsa.PrivateKey) error
- func WritePublicKeyPem(w io.Writer, pubKey *rsa.PublicKey) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptWithPrivateKey ¶ added in v1.9.5
func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) ([]byte, error)
DecryptWithPrivateKey decrypts data with private key
func EncryptWithPublicKey ¶ added in v1.9.5
EncryptWithPublicKey encrypts data with public key
func GetBufferPool ¶ added in v1.9.5
func GetStringsBuilder ¶ added in v1.9.5
func GetUrlValues ¶ added in v1.9.5
func JSONMarshal ¶
func JSONMarshal(req interface{}) []byte
JSONMarshal encode json without html escape
func ParsePrivateKeyFromPem ¶ added in v1.9.5
func ParsePrivateKeyFromPem(bs []byte) (*rsa.PrivateKey, error)
func ParsePublicKeyFromPem ¶ added in v1.9.5
ParsePublicKeyFromPem read public key from pem file
func PutBufferPool ¶ added in v1.9.5
func PutStringsBuilder ¶ added in v1.9.5
func PutUrlValues ¶ added in v1.9.5
func ReadPrivateKeyFromPem ¶ added in v1.9.5
func ReadPrivateKeyFromPem(r io.Reader) (*rsa.PrivateKey, error)
ReadPrivateKeyFromPem read private key from pem file
func ReadPublicKeyFromPem ¶ added in v1.9.5
ReadPublicKeyFromPem read public key from pem file
func SignWithPrivateKey ¶ added in v1.9.5
func SignWithPrivateKey(msg []byte, privKey *rsa.PrivateKey) ([]byte, error)
SignWithPrivateKey sign data with private key
func StringsJoin ¶ added in v1.9.5
func VerifyWithPublicKey ¶ added in v1.9.5
VerifyWithPublicKey sign data with private key
func WritePrivateKeyPem ¶ added in v1.9.5
func WritePrivateKeyPem(w io.Writer, privKey *rsa.PrivateKey) error
WritePrivateKeyPem write private key to pem file
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.