Documentation ¶
Index ¶
- func DecryptFromBase64(privateKey rsa.PrivateKey, cipher string) (string, error)
- func DecryptOAEP(privateKey rsa.PrivateKey, cipher []byte) ([]byte, error)
- func DecryptPKCS1v15(privateKey rsa.PrivateKey, cipher []byte) ([]byte, error)
- func EncryptIntoBase64(publicKey rsa.PublicKey, plain string) (string, error)
- func EncryptOAEP(publicKey rsa.PublicKey, plain []byte) ([]byte, error)
- func EncryptPKCS1v15(publicKey rsa.PublicKey, plain []byte) ([]byte, error)
- func FormatKey(key string) (string, error)
- func ParseIntoAuthorizedKeyBuf(publicKey *rsa.PublicKey) (*ssh.PublicKey, *bytes.Buffer)
- func ParseIntoPrivateKeyBuf(privateKey *rsa.PrivateKey) *bytes.Buffer
- func ParseIntoPublicKeyBuf(publicKey *rsa.PublicKey) *bytes.Buffer
- func ParsePrivateKey(privateKey string) *rsa.PrivateKey
- func ParsePublicKey(publicKey string) *rsa.PublicKey
- func SignPKCS1v15(privateKey *rsa.PrivateKey, target []byte) ([]byte, error)
- func SignPSS(privateKey *rsa.PrivateKey, target []byte) ([]byte, error)
- func SignText(privateKey *rsa.PrivateKey, plain string) string
- func VerifyPKCS1v15(publicKey *rsa.PublicKey, target []byte, signature []byte) error
- func VerifyPSS(publicKey *rsa.PublicKey, signature []byte) error
- func VerifyText(publicKey *rsa.PublicKey, content string, signature string) bool
- type RSAKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptFromBase64 ¶
func DecryptFromBase64(privateKey rsa.PrivateKey, cipher string) (string, error)
func DecryptOAEP ¶
func DecryptOAEP(privateKey rsa.PrivateKey, cipher []byte) ([]byte, error)
func DecryptPKCS1v15 ¶
func DecryptPKCS1v15(privateKey rsa.PrivateKey, cipher []byte) ([]byte, error)
func EncryptIntoBase64 ¶
func ParseIntoPrivateKeyBuf ¶
func ParseIntoPrivateKeyBuf(privateKey *rsa.PrivateKey) *bytes.Buffer
func ParsePrivateKey ¶
func ParsePrivateKey(privateKey string) *rsa.PrivateKey
func ParsePublicKey ¶
func SignPKCS1v15 ¶
func SignPKCS1v15(privateKey *rsa.PrivateKey, target []byte) ([]byte, error)
func VerifyPKCS1v15 ¶
Types ¶
type RSAKey ¶
type RSAKey struct { PrivateKey *rsa.PrivateKey PrivateKeyBuff *bytes.Buffer PrivateKeyText string PrivateKeyBase64 string PublicKey *rsa.PublicKey PublicKeyBuff *bytes.Buffer PublicKeyText string PublicKeyBase64 string AuthorizedKey *ssh.PublicKey AuthorizedKeyBuff *bytes.Buffer AuthorizedKeyText string AuthorizedKeyBase64 string }
func GenerateRSAKeyPair ¶
Click to show internal directories.
Click to hide internal directories.