Documentation ¶
Index ¶
- Variables
- type Ecdh
- func FromECDHPrivateKey(key []byte) Ecdh
- func FromECDHPrivateKeyWithPassword(key []byte, password string) Ecdh
- func FromECDHPublicKey(key []byte) Ecdh
- func FromPrivateKey(key []byte) Ecdh
- func FromPrivateKeyWithPassword(key []byte, password string) Ecdh
- func FromPublicKey(key []byte) Ecdh
- func GenerateKey(curve string) Ecdh
- func GenerateKeyWithSeed(reader io.Reader, curve string) Ecdh
- func New() Ecdh
- func NewEcdh() Ecdh
- func (this Ecdh) AppendError(err ...error) Ecdh
- func (this Ecdh) CheckKeyPair() bool
- func (this Ecdh) CreateECDHPrivateKey() Ecdh
- func (this Ecdh) CreateECDHPrivateKeyWithPassword(password string, opts ...any) Ecdh
- func (this Ecdh) CreateECDHPublicKey() Ecdh
- func (this Ecdh) CreatePrivateKey() Ecdh
- func (this Ecdh) CreatePrivateKeyWithPassword(password string, opts ...any) Ecdh
- func (this Ecdh) CreatePublicKey() Ecdh
- func (this Ecdh) CreateSecretKey() Ecdh
- func (this Ecdh) Error() error
- func (this Ecdh) FromECDHPrivateKey(key []byte) Ecdh
- func (this Ecdh) FromECDHPrivateKeyDer(der []byte) Ecdh
- func (this Ecdh) FromECDHPrivateKeyWithPassword(key []byte, password string) Ecdh
- func (this Ecdh) FromECDHPublicKey(key []byte) Ecdh
- func (this Ecdh) FromECDHPublicKeyDer(der []byte) Ecdh
- func (this Ecdh) FromPrivateKey(key []byte) Ecdh
- func (this Ecdh) FromPrivateKeyDer(der []byte) Ecdh
- func (this Ecdh) FromPrivateKeyWithPassword(key []byte, password string) Ecdh
- func (this Ecdh) FromPublicKey(key []byte) Ecdh
- func (this Ecdh) FromPublicKeyDer(der []byte) Ecdh
- func (this Ecdh) GenerateKey() Ecdh
- func (this Ecdh) GenerateKeyWithSeed(reader io.Reader) 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) ParseECDHPrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error)
- func (this Ecdh) ParseECDHPrivateKeyFromPEMWithPassword(key []byte, password string) (crypto.PrivateKey, error)
- func (this Ecdh) ParseECDHPublicKeyFromPEM(key []byte) (crypto.PublicKey, error)
- 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(curve 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 FromECDHPrivateKey ¶ added in v1.0.2017
私钥, 库自使用的 asn1 格式
func FromECDHPrivateKeyWithPassword ¶ added in v1.0.2017
私钥, 库自使用的 asn1 格式
func FromECDHPublicKey ¶ added in v1.0.2017
公钥, 库自使用的 asn1 格式
func FromPrivateKeyWithPassword ¶ added in v1.0.2014
私钥
func GenerateKeyWithSeed ¶ added in v1.0.2026
生成密钥
func (Ecdh) CreateECDHPrivateKey ¶ added in v1.0.2017
生成私钥 pem 数据, 库自使用的 asn1 格式
func (Ecdh) CreateECDHPrivateKeyWithPassword ¶ added in v1.0.2017
生成 PKCS8 私钥带密码 pem 数据, 库自使用的 asn1 格式
func (Ecdh) CreateECDHPublicKey ¶ added in v1.0.2017
生成公钥 pem 数据, 库自使用的 asn1 格式
func (Ecdh) CreatePrivateKey ¶
生成私钥 pem 数据 使用: obj := New().SetCurve("P256").GenerateKey() priKey := obj.CreatePrivateKey().ToKeyString()
func (Ecdh) CreatePrivateKeyWithPassword ¶
生成 PKCS8 私钥带密码 pem 数据 CreatePrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (Ecdh) FromECDHPrivateKey ¶ added in v1.0.2017
私钥, 库自使用的 asn1 格式
func (Ecdh) FromECDHPrivateKeyDer ¶ added in v1.0.2017
DER 私钥, 库自使用的 asn1 格式
func (Ecdh) FromECDHPrivateKeyWithPassword ¶ added in v1.0.2017
私钥带密码, 库自使用的 asn1 格式
func (Ecdh) FromECDHPublicKey ¶ added in v1.0.2017
公钥, 库自使用的 asn1 格式
func (Ecdh) FromECDHPublicKeyDer ¶ added in v1.0.2017
DER 公钥, 库自使用的 asn1 格式
func (Ecdh) FromPrivateKeyDer ¶ added in v1.0.2015
DER 私钥
func (Ecdh) FromPrivateKeyWithPassword ¶
私钥带密码
func (Ecdh) FromPublicKeyDer ¶ added in v1.0.2015
DER 公钥
func (Ecdh) GenerateKeyWithSeed ¶ added in v1.0.2026
生成密钥
func (Ecdh) ParseECDHPrivateKeyFromPEM ¶ added in v1.0.2017
func (this Ecdh) ParseECDHPrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error)
解析私钥
func (Ecdh) ParseECDHPrivateKeyFromPEMWithPassword ¶ added in v1.0.2017
func (this Ecdh) ParseECDHPrivateKeyFromPEMWithPassword(key []byte, password string) (crypto.PrivateKey, error)
解析私钥带密码
func (Ecdh) ParseECDHPublicKeyFromPEM ¶ added in v1.0.2017
解析公钥
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.