Documentation ¶
Index ¶
- Variables
- type DSAErrorFunc
- type ElGamal
- func FromBase64String(data string) ElGamal
- func FromBytes(data []byte) ElGamal
- func FromHexString(data string) ElGamal
- func FromPKCS1PrivateKey(key []byte) ElGamal
- func FromPKCS1PrivateKeyWithPassword(key []byte, password string) ElGamal
- func FromPKCS1PublicKey(key []byte) ElGamal
- func FromPKCS8PrivateKey(key []byte) ElGamal
- func FromPKCS8PrivateKeyWithPassword(key []byte, password string) ElGamal
- func FromPKCS8PublicKey(key []byte) ElGamal
- func FromPrivateKey(key []byte) ElGamal
- func FromPrivateKeyWithPassword(key []byte, password string) ElGamal
- func FromPublicKey(key []byte) ElGamal
- func FromString(data string) ElGamal
- func FromXMLPrivateKey(key []byte) ElGamal
- func FromXMLPublicKey(key []byte) ElGamal
- func GenerateKey(bitsize, probability int) ElGamal
- func GenerateKeyWithSeed(reader io.Reader, bitsize, probability int) ElGamal
- func New() ElGamal
- func NewElGamal() ElGamal
- func (this ElGamal) AppendError(err ...error) ElGamal
- func (this ElGamal) CheckKeyPair() bool
- func (this ElGamal) CreatePKCS1PrivateKey() ElGamal
- func (this ElGamal) CreatePKCS1PrivateKeyWithPassword(password string, opts ...string) ElGamal
- func (this ElGamal) CreatePKCS1PublicKey() ElGamal
- func (this ElGamal) CreatePKCS8PrivateKey() ElGamal
- func (this ElGamal) CreatePKCS8PrivateKeyWithPassword(password string, opts ...any) ElGamal
- func (this ElGamal) CreatePKCS8PublicKey() ElGamal
- func (this ElGamal) CreatePrivateKey() ElGamal
- func (this ElGamal) CreatePrivateKeyWithPassword(password string, opts ...string) ElGamal
- func (this ElGamal) CreatePublicKey() ElGamal
- func (this ElGamal) CreateXMLPrivateKey() ElGamal
- func (this ElGamal) CreateXMLPublicKey() ElGamal
- func (this ElGamal) Decrypt() ElGamal
- func (this ElGamal) Encrypt() ElGamal
- func (this ElGamal) Error() error
- func (this ElGamal) FromBase64String(data string) ElGamal
- func (this ElGamal) FromBytes(data []byte) ElGamal
- func (this ElGamal) FromHexString(data string) ElGamal
- func (this ElGamal) FromPKCS1PrivateKey(key []byte) ElGamal
- func (this ElGamal) FromPKCS1PrivateKeyDer(der []byte) ElGamal
- func (this ElGamal) FromPKCS1PrivateKeyWithPassword(key []byte, password string) ElGamal
- func (this ElGamal) FromPKCS1PublicKey(key []byte) ElGamal
- func (this ElGamal) FromPKCS1PublicKeyDer(der []byte) ElGamal
- func (this ElGamal) FromPKCS8PrivateKey(key []byte) ElGamal
- func (this ElGamal) FromPKCS8PrivateKeyDer(der []byte) ElGamal
- func (this ElGamal) FromPKCS8PrivateKeyWithPassword(key []byte, password string) ElGamal
- func (this ElGamal) FromPKCS8PublicKey(key []byte) ElGamal
- func (this ElGamal) FromPKCS8PublicKeyDer(der []byte) ElGamal
- func (this ElGamal) FromPrivateKey(key []byte) ElGamal
- func (this ElGamal) FromPrivateKeyWithPassword(key []byte, password string) ElGamal
- func (this ElGamal) FromPublicKey(key []byte) ElGamal
- func (this ElGamal) FromString(data string) ElGamal
- func (this ElGamal) FromXMLPrivateKey(key []byte) ElGamal
- func (this ElGamal) FromXMLPublicKey(key []byte) ElGamal
- func (this ElGamal) GenerateKey(bitsize, probability int) ElGamal
- func (this ElGamal) GenerateKeyWithSeed(reader io.Reader, bitsize, probability int) ElGamal
- func (this ElGamal) GetData() []byte
- func (this ElGamal) GetErrors() []error
- func (this ElGamal) GetKeyData() []byte
- func (this ElGamal) GetParsedData() []byte
- func (this ElGamal) GetPrivateKey() *elgamal.PrivateKey
- func (this ElGamal) GetPublicKey() *elgamal.PublicKey
- func (this ElGamal) GetSignHash() HashFunc
- func (this ElGamal) GetVerify() bool
- func (this ElGamal) MakeKeyDer() ElGamal
- func (this ElGamal) MakePublicKey() ElGamal
- func (this ElGamal) OnError(fn DSAErrorFunc) ElGamal
- func (this ElGamal) ParsePKCS1PrivateKeyFromPEM(key []byte) (*elgamal.PrivateKey, error)
- func (this ElGamal) ParsePKCS1PrivateKeyFromPEMWithPassword(key []byte, password string) (*elgamal.PrivateKey, error)
- func (this ElGamal) ParsePKCS1PublicKeyFromPEM(key []byte) (*elgamal.PublicKey, error)
- func (this ElGamal) ParsePKCS8PrivateKeyFromPEM(key []byte) (*elgamal.PrivateKey, error)
- func (this ElGamal) ParsePKCS8PrivateKeyFromPEMWithPassword(key []byte, password string) (*elgamal.PrivateKey, error)
- func (this ElGamal) ParsePKCS8PublicKeyFromPEM(key []byte) (*elgamal.PublicKey, error)
- func (this ElGamal) ParsePrivateKeyFromXML(key []byte) (*elgamal.PrivateKey, error)
- func (this ElGamal) ParsePublicKeyFromXML(key []byte) (*elgamal.PublicKey, error)
- func (this ElGamal) SetSignHash(data string) ElGamal
- func (this ElGamal) Sign() ElGamal
- func (this ElGamal) ToBase64String() string
- func (this ElGamal) ToBytes() []byte
- func (this ElGamal) ToHexString() string
- func (this ElGamal) ToKeyBytes() []byte
- func (this ElGamal) ToKeyString() string
- func (this ElGamal) ToString() string
- func (this ElGamal) ToVerify() bool
- func (this ElGamal) ToVerifyInt() int
- func (this ElGamal) Verify(data []byte) ElGamal
- func (this ElGamal) WithData(data []byte) ElGamal
- func (this ElGamal) WithErrors(errs []error) ElGamal
- func (this ElGamal) WithParsedData(data []byte) ElGamal
- func (this ElGamal) WithPrivateKey(data *elgamal.PrivateKey) ElGamal
- func (this ElGamal) WithPublicKey(data *elgamal.PublicKey) ElGamal
- func (this ElGamal) WithSignHash(data HashFunc) ElGamal
- func (this ElGamal) WithVerify(data bool) ElGamal
- type HashFunc
- type Opts
- type PBKDF2Opts
- type ScryptOpts
Constants ¶
This section is empty.
Variables ¶
var ( // 获取 Cipher 类型 GetCipherFromName = pkcs8.GetCipherFromName // 获取 hash 类型 GetHashFromName = pkcs8.GetHashFromName )
Functions ¶
This section is empty.
Types ¶
type ElGamal ¶ added in v1.0.4022
type ElGamal struct { // 错误 Errors []error // contains filtered or unexported fields }
*
- ElGamal *
- @create 2023-6-22
- @author deatil
func FromPKCS1PrivateKeyWithPassword ¶
PKCS1 私钥带密码
func FromPKCS8PrivateKeyWithPassword ¶
PKCS8 私钥带密码
func FromPrivateKeyWithPassword ¶
私钥带密码
func GenerateKeyWithSeed ¶ added in v1.0.2026
使用数据生成密钥对
func (ElGamal) AppendError ¶ added in v1.0.4022
添加错误
func (ElGamal) CreatePKCS1PrivateKey ¶ added in v1.0.4022
生成 pkcs1 私钥 pem 数据
func (ElGamal) CreatePKCS1PrivateKeyWithPassword ¶ added in v1.0.4022
生成 pkcs1 私钥带密码 pem 数据 CreatePKCS1PrivateKeyWithPassword("123", "AES256CBC") PEMCipher: DESCBC | DESEDE3CBC | AES128CBC | AES192CBC | AES256CBC
func (ElGamal) CreatePKCS1PublicKey ¶ added in v1.0.4022
生成 pkcs1 公钥 pem 数据
func (ElGamal) CreatePKCS8PrivateKey ¶ added in v1.0.4022
生成 pkcs8 私钥 pem 数据
func (ElGamal) CreatePKCS8PrivateKeyWithPassword ¶ added in v1.0.4022
生成 PKCS8 私钥带密码 pem 数据 CreatePKCS8PrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (ElGamal) CreatePKCS8PublicKey ¶ added in v1.0.4022
生成公钥 pem 数据
func (ElGamal) CreatePrivateKey ¶ added in v1.0.4022
生成私钥 pem 数据 elgamal := New().GenerateKey("L2048N256") priKey := elgamal.CreatePrivateKey().ToKeyString()
func (ElGamal) CreatePrivateKeyWithPassword ¶ added in v1.0.4022
生成私钥带密码 pem 数据 CreatePrivateKeyWithPassword("123", "AES256CBC") PEMCipher: DESCBC | DESEDE3CBC | AES128CBC | AES192CBC | AES256CBC
func (ElGamal) CreatePublicKey ¶ added in v1.0.4022
生成公钥 pem 数据
func (ElGamal) CreateXMLPrivateKey ¶ added in v1.0.4022
生成私钥 xml 数据
func (ElGamal) CreateXMLPublicKey ¶ added in v1.0.4022
生成公钥 xml 数据
func (ElGamal) FromBase64String ¶ added in v1.0.4022
Base64
func (ElGamal) FromHexString ¶ added in v1.0.4022
Hex
func (ElGamal) FromPKCS1PrivateKey ¶ added in v1.0.4022
PKCS1 私钥
func (ElGamal) FromPKCS1PrivateKeyDer ¶ added in v1.0.4022
Pkcs1 DER 私钥
func (ElGamal) FromPKCS1PrivateKeyWithPassword ¶ added in v1.0.4022
PKCS1 私钥带密码
func (ElGamal) FromPKCS1PublicKey ¶ added in v1.0.4022
PKCS1 公钥
func (ElGamal) FromPKCS1PublicKeyDer ¶ added in v1.0.4022
PKCS1 DER 公钥
func (ElGamal) FromPKCS8PrivateKey ¶ added in v1.0.4022
PKCS8 私钥
func (ElGamal) FromPKCS8PrivateKeyDer ¶ added in v1.0.4022
Pkcs8 DER 私钥
func (ElGamal) FromPKCS8PrivateKeyWithPassword ¶ added in v1.0.4022
PKCS8 私钥带密码
func (ElGamal) FromPKCS8PublicKey ¶ added in v1.0.4022
PKCS8 公钥
func (ElGamal) FromPKCS8PublicKeyDer ¶ added in v1.0.4022
PKCS8 DER 公钥
func (ElGamal) FromPrivateKey ¶ added in v1.0.4022
私钥
func (ElGamal) FromPrivateKeyWithPassword ¶ added in v1.0.4022
私钥带密码
func (ElGamal) FromPublicKey ¶ added in v1.0.4022
公钥
func (ElGamal) FromString ¶ added in v1.0.4022
字符
func (ElGamal) FromXMLPrivateKey ¶ added in v1.0.4022
XML 私钥
func (ElGamal) FromXMLPublicKey ¶ added in v1.0.4022
XML 公钥
func (ElGamal) GenerateKey ¶ added in v1.0.4022
生成密钥
func (ElGamal) GenerateKeyWithSeed ¶ added in v1.0.4022
使用数据生成密钥对
func (ElGamal) GetParsedData ¶ added in v1.0.4022
获取 parsedData
func (ElGamal) GetPrivateKey ¶ added in v1.0.4022
func (this ElGamal) GetPrivateKey() *elgamal.PrivateKey
获取 PrivateKey
func (ElGamal) GetPublicKey ¶ added in v1.0.4022
获取 PublicKey
func (ElGamal) GetSignHash ¶ added in v1.0.4022
获取 hash 类型
func (ElGamal) OnError ¶ added in v1.0.4022
func (this ElGamal) OnError(fn DSAErrorFunc) ElGamal
引出错误信息
func (ElGamal) ParsePKCS1PrivateKeyFromPEM ¶ added in v1.0.4022
func (this ElGamal) ParsePKCS1PrivateKeyFromPEM(key []byte) (*elgamal.PrivateKey, error)
解析私钥
func (ElGamal) ParsePKCS1PrivateKeyFromPEMWithPassword ¶ added in v1.0.4022
func (this ElGamal) ParsePKCS1PrivateKeyFromPEMWithPassword(key []byte, password string) (*elgamal.PrivateKey, error)
解析私钥带密码
func (ElGamal) ParsePKCS1PublicKeyFromPEM ¶ added in v1.0.4022
解析公钥
func (ElGamal) ParsePKCS8PrivateKeyFromPEM ¶ added in v1.0.4022
func (this ElGamal) ParsePKCS8PrivateKeyFromPEM(key []byte) (*elgamal.PrivateKey, error)
解析私钥 PKCS8
func (ElGamal) ParsePKCS8PrivateKeyFromPEMWithPassword ¶ added in v1.0.4022
func (this ElGamal) ParsePKCS8PrivateKeyFromPEMWithPassword(key []byte, password string) (*elgamal.PrivateKey, error)
解析 PKCS8 带密码的私钥
func (ElGamal) ParsePKCS8PublicKeyFromPEM ¶ added in v1.0.4022
解析公钥 PKCS8
func (ElGamal) ParsePrivateKeyFromXML ¶ added in v1.0.4022
func (this ElGamal) ParsePrivateKeyFromXML(key []byte) (*elgamal.PrivateKey, error)
解析 xml 私钥
func (ElGamal) ParsePublicKeyFromXML ¶ added in v1.0.4022
解析 xml 公钥
func (ElGamal) SetSignHash ¶ added in v1.0.4022
设置 hash 类型 可用参数可查看 Hash 结构体数据
func (ElGamal) ToBase64String ¶ added in v1.0.4022
输出Base64
func (ElGamal) ToVerifyInt ¶ added in v1.0.4022
验证结果,返回 int 类型
func (ElGamal) WithErrors ¶ added in v1.0.4022
设置错误
func (ElGamal) WithParsedData ¶ added in v1.0.4022
设置 parsedData
func (ElGamal) WithPrivateKey ¶ added in v1.0.4022
func (this ElGamal) WithPrivateKey(data *elgamal.PrivateKey) ElGamal
设置 PrivateKey
func (ElGamal) WithPublicKey ¶ added in v1.0.4022
设置 PublicKey
func (ElGamal) WithSignHash ¶ added in v1.0.4022
设置 hash 类型
func (ElGamal) WithVerify ¶ added in v1.0.4022
设置 verify