Documentation
¶
Index ¶
- Constants
- func Base16ToHex(b string) string
- func ExtractResponseData(res *http.Response) ([]byte, error)
- func LPad(text string, n int, char string) string
- func RPad(text string, n int, char string) string
- func ReadFile(path string) ([]byte, error)
- func SHA1Encode(val []byte) []byte
- func SaveKeys(keys Keys) error
- func WriteFile(path string, content []byte) error
- type Keys
Constants ¶
View Source
const PrivateKeyPath = "key.rsa"
View Source
const PublicKeyPath = "key.rsa.pub"
Variables ¶
This section is empty.
Functions ¶
func Base16ToHex ¶ added in v0.4.0
Base16ToHex converts a string in base-16 to its hexadecimal representation.
func ExtractResponseData ¶ added in v0.3.0
ExtractResponseData reads the HTTP response body and returns it as a byte slice.
func LPad ¶ added in v0.3.0
LPad pads the input string `text` on the left with the specified `char` until it reaches the desired length `n`.
func RPad ¶ added in v0.3.0
RPad pads the input `text` on the right with the specified `char` until it reaches the desired length `n`.
func ReadFile ¶
ReadFile reads the contents of a file at the given path and returns the data as a byte slice or an error.
func SHA1Encode ¶ added in v0.3.0
SHA1Encode computes and returns the SHA-1 hash of the given byte slice.
Types ¶
type Keys ¶ added in v0.3.0
func GenerateKeys ¶ added in v0.3.0
GenerateKeys generates a new RSA key pair, encodes them in PEM format.
Click to show internal directories.
Click to hide internal directories.