Versions in this module Expand all Collapse all v0 v0.0.5 Jan 19, 2023 Changes in this version + const Name + type Curve int + const P224 + const P256 + const P384 + const P521 + func (c Curve) New() elliptic.Curve + type Decryptor struct + func NewDecryptor(opts ...DecryptorOption) *Decryptor + func (d *Decryptor) Decrypt(ciphertext []byte) ([]byte, error) + func (d *Decryptor) Name() string + type DecryptorOption func(o *decryptorOptions) + func WithDecryptorPrivateKey(privateKey string) DecryptorOption + func WithDecryptorShareInfo(s1, s2 string) DecryptorOption + type Encryptor struct + func NewEncryptor(opts ...EncryptorOption) *Encryptor + func (e *Encryptor) Encrypt(data []byte) ([]byte, error) + func (e *Encryptor) Name() string + type EncryptorOption func(o *encryptorOptions) + func WithEncryptorPublicKey(publicKey string) EncryptorOption + func WithEncryptorShareInfo(s1, s2 string) EncryptorOption + type Key struct + func GenerateKey(curve Curve) (*Key, error) + func (k *Key) MarshalPrivateKey() ([]byte, error) + func (k *Key) MarshalPublicKey() ([]byte, error) + func (k *Key) PrivateKey() *ecdsa.PrivateKey + func (k *Key) PublicKey() *ecdsa.PublicKey + func (k *Key) SaveKeyPair(dir string, file string) (err error) + type Signer struct + func NewSigner(opts ...SignerOption) *Signer + func (s *Signer) Name() string + func (s *Signer) Sign(data []byte) ([]byte, error) + type SignerOption func(o *signerOptions) + func WithSignerDelimiter(delimiter string) SignerOption + func WithSignerHash(hash hash.Hash) SignerOption + func WithSignerPrivateKey(privateKey string) SignerOption + type Verifier struct + func NewVerifier(opts ...VerifierOption) *Verifier + func (v *Verifier) Name() string + func (v *Verifier) Verify(data []byte, signature []byte) (bool, error) + type VerifierOption func(o *verifierOption) + func WithVerifierDelimiter(delimiter string) VerifierOption + func WithVerifierHash(hash hash.Hash) VerifierOption + func WithVerifierPublicKey(publicKey string) VerifierOption