| .. | ||
| README.md | ||
| RFC.md | ||
rsa
Import: dappco.re/go/core/crypt/crypt/rsa
Files: 1
Types
Service
type Service struct{}
Service provides RSA functionality. Usage: use Service with the other exported helpers in this package.
Methods
Decrypt
func (s *Service) Decrypt(privateKey, ciphertext, label []byte) ([]byte, error)
Decrypt decrypts data with a private key. Usage: call Decrypt(...) during the package's normal workflow.
Encrypt
func (s *Service) Encrypt(publicKey, data, label []byte) ([]byte, error)
Encrypt encrypts data with a public key. Usage: call Encrypt(...) during the package's normal workflow.
GenerateKeyPair
func (s *Service) GenerateKeyPair(bits int) (publicKey, privateKey []byte, err error)
GenerateKeyPair creates a new RSA key pair. Usage: call GenerateKeyPair(...) during the package's normal workflow.
Functions
NewService
func NewService() *Service
NewService creates and returns a new Service instance for performing RSA-related operations. Usage: call NewService(...) to create a ready-to-use value.