Documentation ¶
Index ¶
- Variables
- type Ecdh
- func (this Ecdh) AppendError(err ...error) Ecdh
- 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) CreateSecret() Ecdh
- func (this Ecdh) Error() cryptobin_tool.Errors
- func (this Ecdh) FromKeyXYHexString(xString string, yString string) Ecdh
- func (this Ecdh) FromPrivateKey(key []byte) Ecdh
- func (this Ecdh) FromPrivateKeyWithPassword(key []byte, password string) Ecdh
- func (this Ecdh) FromPrivateKeyXHexString(xString string) Ecdh
- func (this Ecdh) FromPublicKey(key []byte) Ecdh
- func (this Ecdh) FromPublicKeyYHexString(yString string) 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) GetPrivateKeyXHexString() string
- func (this Ecdh) GetPublicKey() *ecdh.PublicKey
- func (this Ecdh) GetPublicKeyYHexString() string
- func (this Ecdh) GetSecretData() []byte
- 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 *
- @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().GenerateKey("P2048") priKey := obj.CreatePrivateKey().ToKeyString()
func (Ecdh) CreatePrivateKeyWithPassword ¶
生成 PKCS8 私钥带密码 pem 数据 CreatePrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (Ecdh) FromKeyXYHexString ¶ added in v1.0.1025
根据私钥 x, y 生成
func (Ecdh) FromPrivateKeyWithPassword ¶
私钥带密码
func (Ecdh) FromPrivateKeyXHexString ¶ added in v1.0.1025
根据私钥 x 生成
func (Ecdh) FromPublicKeyYHexString ¶ added in v1.0.1025
根据公钥 y 生成
func (Ecdh) GetPrivateKeyXHexString ¶ added in v1.0.1025
获取 X 16进制字符
func (Ecdh) GetPublicKeyYHexString ¶ added in v1.0.1025
获取 Y 16进制字符
func (Ecdh) GetSecretData ¶ added in v1.0.1026
获取 secretData
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
func (Ecdh) WithSecretData ¶ added in v1.0.1026
设置 secretData
Click to show internal directories.
Click to hide internal directories.