Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDataToLarge = errors.New("message too long for RSA public key size") ErrDataLen = errors.New("data length error") ErrDataBroken = errors.New("data broken, first byte is not zero") ErrKeyPairDismatch = errors.New("data is not encrypted by the private key") )
View Source
var RSA = &RSASecurity{}
Functions ¶
func PublicEncrypt ¶
Types ¶
type RSASecurity ¶
type RSASecurity struct {
// contains filtered or unexported fields
}
func (*RSASecurity) GetPublickey ¶
func (rsas *RSASecurity) GetPublickey() (*rsa.PublicKey, error)
func (*RSASecurity) PubKeyDECRYPT ¶
func (rsas *RSASecurity) PubKeyDECRYPT(input []byte) ([]byte, error)
func (*RSASecurity) PubKeyENCTYPT ¶
func (rsas *RSASecurity) PubKeyENCTYPT(input []byte) ([]byte, error)
func (*RSASecurity) SetPublicKey ¶
func (rsas *RSASecurity) SetPublicKey(pubStr string) (err error)
Click to show internal directories.
Click to hide internal directories.