Documentation ¶
Index ¶
- Constants
- Variables
- func Decrypt(ciphertext []byte) ([]byte, error)
- func Encrypt(data []byte) ([]byte, error)
- func Sign(data []byte) ([]byte, error)
- func Verify(data []byte, signature []byte) (bool, error)
- type Curve
- type Decryptor
- type DecryptorOption
- type Encryptor
- type EncryptorOption
- type Key
- type Signer
- type SignerOption
- type Verifier
- type VerifierOption
Constants ¶
View Source
const Name = "ecc"
Variables ¶
View Source
var DefaultDecryptor = NewDecryptor()
View Source
var DefaultEncryptor = NewEncryptor()
View Source
var DefaultSigner = NewSigner()
View Source
var DefaultVerifier = NewVerifier()
Functions ¶
Types ¶
type Decryptor ¶
type Decryptor struct {
// contains filtered or unexported fields
}
func NewDecryptor ¶
func NewDecryptor(opts ...DecryptorOption) *Decryptor
type DecryptorOption ¶
type DecryptorOption func(o *decryptorOptions)
func WithDecryptorPrivateKey ¶
func WithDecryptorPrivateKey(privateKey string) DecryptorOption
WithDecryptorPrivateKey 设置解密私钥
func WithDecryptorShareInfo ¶
func WithDecryptorShareInfo(s1, s2 string) DecryptorOption
WithDecryptorShareInfo 设置共享信息
type Encryptor ¶
type Encryptor struct {
// contains filtered or unexported fields
}
func NewEncryptor ¶
func NewEncryptor(opts ...EncryptorOption) *Encryptor
type EncryptorOption ¶
type EncryptorOption func(o *encryptorOptions)
func WithEncryptorPublicKey ¶
func WithEncryptorPublicKey(publicKey string) EncryptorOption
WithEncryptorPublicKey 设置加密公钥
func WithEncryptorShareInfo ¶
func WithEncryptorShareInfo(s1, s2 string) EncryptorOption
WithEncryptorShareInfo 设置共享信息
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
func (*Key) MarshalPrivateKey ¶
MarshalPrivateKey 编码私钥
func (*Key) MarshalPublicKey ¶
MarshalPublicKey 编码公钥
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
func NewSigner ¶
func NewSigner(opts ...SignerOption) *Signer
type SignerOption ¶
type SignerOption func(o *signerOptions)
func WithSignerDelimiter ¶
func WithSignerDelimiter(delimiter string) SignerOption
WithSignerDelimiter 设置签名分割符
func WithSignerPrivateKey ¶
func WithSignerPrivateKey(privateKey string) SignerOption
WithSignerPrivateKey 设置解密私钥
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
func NewVerifier ¶
func NewVerifier(opts ...VerifierOption) *Verifier
type VerifierOption ¶
type VerifierOption func(o *verifierOption)
func WithVerifierDelimiter ¶
func WithVerifierDelimiter(delimiter string) VerifierOption
WithVerifierDelimiter 设置签名分割符
func WithVerifierHash ¶
func WithVerifierHash(hash hash.Hash) VerifierOption
WithVerifierHash 设置加密hash算法
func WithVerifierPublicKey ¶
func WithVerifierPublicKey(publicKey string) VerifierOption
WithVerifierPublicKey 设置验签公钥
Source Files ¶
Click to show internal directories.
Click to hide internal directories.