Documentation ¶
Index ¶
- Variables
- func FormatPayloadToSign(opts *FormOpts) string
- type Creator
- type FormOpts
- type OptArgs
- type Options
- type Service
- func (s *Service) Decrypt(ctx context.Context, message []byte) ([]byte, error)
- func (s *Service) Encrypt(ctx context.Context, message []byte) ([]byte, error)
- func (s *Service) GetOption() *Options
- func (s *Service) GetRSAPrivateKey() *rsa.PrivateKey
- func (s *Service) GetRSAPublicKey() *rsa.PublicKey
- func (s *Service) SetOption(opts *Options)
- func (s *Service) Sign(ctx context.Context, message []byte) (string, error)
- func (s *Service) Verify(ctx context.Context, signature string) (*Verified, error)
- type Verified
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// CaretB ...
CaretB = "�"
)
View Source
var ( // ErrMissingParams ... ErrMissingParams = errors.New("missing required parameters") )
Functions ¶
Types ¶
type Creator ¶
type Creator interface { Encrypt(ctx context.Context, message []byte) ([]byte, error) Decrypt(ctx context.Context, message []byte) ([]byte, error) Sign(ctx context.Context, message []byte) (string, error) Verify(ctx context.Context, signature string) (*Verified, error) SetOption(opts *Options) GetOption() *Options GetRSAPublicKey() *rsa.PublicKey GetRSAPrivateKey() *rsa.PrivateKey }
Creator ...
type FormOpts ¶
type FormOpts struct { Auth string SignUUID string Timestamp int64 Method string Link string Payload []byte Sep string }
FormOpts ...
type Options ¶
Options ...
func (*Options) GetPublicKeyPKCS ¶
GetPublicKeyPKCS ...
func (*Options) GetRSAPrivateKey ¶
func (k *Options) GetRSAPrivateKey() (*rsa.PrivateKey, error)
GetRSAPrivateKey ...
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service ...
func (*Service) GetRSAPrivateKey ¶
func (s *Service) GetRSAPrivateKey() *rsa.PrivateKey
GetRSAPrivateKey ...
func (*Service) GetRSAPublicKey ¶
GetRSAPublicKey ...
type Verified ¶
type Verified struct { Payload string `json:"payload,omitempty"` Protected string `json:"protected,omitempty"` Signature string `json:"signature,omitempty"` Full string `json:"full,omitempty"` Compact string `json:"compact,omitempty"` Data string `json:"data,omitempty"` }
Verified ...
Click to show internal directories.
Click to hide internal directories.