Documentation ¶
Index ¶
- Variables
- type Ecdh
- func (this Ecdh) AppendError(err ...error) Ecdh
- func (this Ecdh) CheckKeyPair() bool
- func (this Ecdh) CreateKdfPrivateKeyWithPassword(password string, opts ...any) Ecdh
- func (this Ecdh) CreatePbePrivateKeyWithPassword(password string, alg string) Ecdh
- func (this Ecdh) CreatePrivateKey() Ecdh
- func (this Ecdh) CreatePrivateKeyWithPassword(password string, opts ...any) Ecdh
- func (this Ecdh) CreatePublicKey() Ecdh
- func (this Ecdh) CreateSecretKey(isCurve ...bool) Ecdh
- func (this Ecdh) Error() error
- func (this Ecdh) FromPrivateKey(key []byte) Ecdh
- func (this Ecdh) FromPrivateKeyWithPassword(key []byte, password string) Ecdh
- func (this Ecdh) FromPublicKey(key []byte) Ecdh
- func (this Ecdh) GenerateKey() Ecdh
- func (this Ecdh) GetCurve() ecdh.Curve
- func (this Ecdh) GetErrors() []error
- func (this Ecdh) GetKeyData() []byte
- func (this Ecdh) GetPrivateKey() *ecdh.PrivateKey
- func (this Ecdh) GetPublicKey() *ecdh.PublicKey
- func (this Ecdh) GetSecretData() []byte
- func (this Ecdh) MakeKeyDer() Ecdh
- func (this Ecdh) MakePublicKey() Ecdh
- func (this Ecdh) OnError(fn ErrorFunc) Ecdh
- func (this Ecdh) ParsePrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error)
- func (this Ecdh) ParsePrivateKeyFromPEMWithPassword(key []byte, password string) (crypto.PrivateKey, error)
- func (this Ecdh) ParsePublicKeyFromPEM(key []byte) (crypto.PublicKey, error)
- func (this Ecdh) SetCurve(name string) Ecdh
- func (this Ecdh) ToBase64String() string
- func (this Ecdh) ToBytes() []byte
- func (this Ecdh) ToHexString() string
- func (this Ecdh) ToKeyBytes() []byte
- func (this Ecdh) ToKeyString() string
- func (this Ecdh) ToString() string
- func (this Ecdh) WithCurve(data ecdh.Curve) Ecdh
- func (this Ecdh) WithErrors(errs []error) Ecdh
- func (this Ecdh) WithKeyData(data []byte) Ecdh
- func (this Ecdh) WithPrivateKey(data *ecdh.PrivateKey) Ecdh
- func (this Ecdh) WithPublicKey(data *ecdh.PublicKey) Ecdh
- func (this Ecdh) WithSecretData(data []byte) Ecdh
- type ErrorFunc
- type Opts
- type PBKDF2Opts
- type ScryptOpts
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 获取 Cipher 类型 GetCipherFromName = cryptobin_pkcs8.GetCipherFromName // 获取 hash 类型 GetHashFromName = cryptobin_pkcs8.GetHashFromName )
Functions ¶
This section is empty.
Types ¶
type Ecdh ¶
type Ecdh struct { // 错误 Errors []error // contains filtered or unexported fields }
*
- ecdh
- go 最低版本需要 `1.20rc1`。 *
- @create 2022-8-7
- @author deatil
func (Ecdh) CreateKdfPrivateKeyWithPassword ¶
生成私钥带密码 pem 数据 CreateKdfPrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (Ecdh) CreatePbePrivateKeyWithPassword ¶
生成 PKCS8 私钥带密码 pem 数据
func (Ecdh) CreatePrivateKey ¶
生成私钥 pem 数据 使用: obj := New().SetCurve("P256").GenerateKey() priKey := obj.CreatePrivateKey().ToKeyString()
func (Ecdh) CreatePrivateKeyWithPassword ¶
生成 PKCS8 私钥带密码 pem 数据 CreatePrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (Ecdh) FromPrivateKeyWithPassword ¶
私钥带密码
func (Ecdh) ParsePrivateKeyFromPEM ¶
func (this Ecdh) ParsePrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error)
解析私钥
func (Ecdh) ParsePrivateKeyFromPEMWithPassword ¶
func (this Ecdh) ParsePrivateKeyFromPEMWithPassword(key []byte, password string) (crypto.PrivateKey, error)
解析私钥带密码
func (Ecdh) ParsePublicKeyFromPEM ¶
解析公钥
func (Ecdh) WithPrivateKey ¶
func (this Ecdh) WithPrivateKey(data *ecdh.PrivateKey) Ecdh
设置 PrivateKey
Click to show internal directories.
Click to hide internal directories.