Documentation ¶
Index ¶
- type CryptoKey
- type Rsa
- func (r *Rsa) CalculateJWK() (res map[string]interface{}, er error)
- func (r *Rsa) Decrypt(data []byte) ([]byte, error)
- func (r *Rsa) DecryptString(data string) (string, error)
- func (r *Rsa) Encrypt(data []byte) ([]byte, error)
- func (r *Rsa) EncryptString(data string) (string, error)
- func (r *Rsa) Export() (string, string)
- func (r *Rsa) ExportBase64() (string, string)
- func (r *Rsa) ExportPrivateBase64() string
- func (r *Rsa) ExportPrivateKey() string
- func (r *Rsa) ExportPublicBase64() string
- func (r *Rsa) ExportPublicKey() string
- func (r *Rsa) Generate(bits int) error
- func (r *Rsa) Import(public string, private string)
- func (r *Rsa) ImportBase64(public string, private string)
- func (r *Rsa) ImportPrivateBase64(key string)
- func (r *Rsa) ImportPrivateKey(key string)
- func (r *Rsa) ImportPublicBase64(key string)
- func (r *Rsa) ImportPublicKey(key string)
- func (r *Rsa) Sign(data []byte) ([]byte, error)
- func (r *Rsa) SignString(data string) (string, error)
- func (r *Rsa) Verify(data []byte, signature []byte) bool
- func (r *Rsa) VerifyString(data string, signature string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CryptoKey ¶
type CryptoKey interface { Generate() ExportPrivateKey() string ExportPublicKey() string Export() (string, string) ImportPrivateKey(key string) ImportPublicKey(key string) Import(public string, private string) ExportPublicBase64() string ExportPrivateBase64() string ExportBase64() (string, string) ImportPublicBase64(key string) ImportPrivateBase64(key string) ImportBase64(public string, private string) ExportJWK() (string, error) Encrypt(data []byte) ([]byte, error) Decrypt(data []byte) ([]byte, error) Sign(data []byte) ([]byte, error) Verify(data []byte, signature []byte) bool EncryptString(data string) (string, error) DecryptString(data string) (string, error) SignString(data string) (string, error) VerifyString(data string, signature string) bool }
type Rsa ¶
type Rsa struct { PrivateKey *rsa.PrivateKey PublicKey *rsa.PublicKey }
func (*Rsa) CalculateJWK ¶
func (*Rsa) ExportBase64 ¶
func (*Rsa) ExportPrivateBase64 ¶
func (*Rsa) ExportPrivateKey ¶
func (*Rsa) ExportPublicBase64 ¶
func (*Rsa) ExportPublicKey ¶
func (*Rsa) ImportBase64 ¶
func (*Rsa) ImportPrivateBase64 ¶
func (*Rsa) ImportPrivateKey ¶
func (*Rsa) ImportPublicBase64 ¶
func (*Rsa) ImportPublicKey ¶
Click to show internal directories.
Click to hide internal directories.