Documentation
¶
Index ¶
- Variables
- type ECDH
- func FromECDHPrivateKey(key []byte) ECDH
- func FromECDHPrivateKeyDer(der []byte) ECDH
- func FromECDHPrivateKeyWithPassword(key []byte, password string) ECDH
- func FromECDHPublicKey(key []byte) ECDH
- func FromECDHPublicKeyDer(der []byte) ECDH
- func FromPrivateKey(key []byte) ECDH
- func FromPrivateKeyDer(der []byte) ECDH
- func FromPrivateKeyWithPassword(key []byte, password string) ECDH
- func FromPublicKey(key []byte) ECDH
- func FromPublicKeyDer(der []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 func([]error)) 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 Opts
- type PBKDF2Opts
- type ScryptOpts
Constants ¶
This section is empty.
Variables ¶
var ( // Get cipher from name GetCipherFromName = pkcs8.GetCipherFromName // Get hash from name GetHashFromName = pkcs8.GetHashFromName )
var ( ErrKeyMustBePEMEncoded = errors.New("go-cryptobin/ecdh: invalid key: Key must be a PEM encoded PKCS1 or PKCS8 key") ErrNotPrivateKey = errors.New("go-cryptobin/ecdh: key is not a valid ecdh private key") ErrNotPublicKey = errors.New("go-cryptobin/ecdh: key is not a valid ecdh public key") )
Functions ¶
This section is empty.
Types ¶
type ECDH ¶ added in v1.0.2048
type ECDH struct {
// error list
Errors []error
// contains filtered or unexported fields
}
*
- ecdh *
- @create 2022-8-7
- @author deatil
func FromECDHPrivateKey ¶ added in v1.0.2017
From ECDH PrivateKey bytes
func FromECDHPrivateKeyDer ¶ added in v1.1.1013
From ECDH PrivateKey Der bytes
func FromECDHPrivateKeyWithPassword ¶ added in v1.0.2017
From ECDH PrivateKey bytes With Password
func FromECDHPublicKey ¶ added in v1.0.2017
From ECDH PublicKey bytes
func FromECDHPublicKeyDer ¶ added in v1.1.1013
From ECDH PublicKey Der bytes
func FromPrivateKeyDer ¶ added in v1.1.1013
From PublicKey Der bytes
func FromPrivateKeyWithPassword ¶ added in v1.0.2014
From PrivateKey bytes With Password
func FromPublicKeyDer ¶ added in v1.1.1013
From PublicKey Der bytes
func GenerateKeyWithSeed ¶ added in v1.0.2026
GenerateKey With Seed
func (ECDH) AppendError ¶ added in v1.0.2048
append error
func (ECDH) CreateECDHPrivateKey ¶ added in v1.0.2048
生成私钥 pem 数据, 库自使用的 asn1 格式 Create PKCS8 PrivateKey PEM data and use the pkg asn1 encode
func (ECDH) CreateECDHPrivateKeyWithPassword ¶ added in v1.0.2048
生成 PKCS8 私钥带密码 pem 数据, 库自使用的 asn1 格式 Create PKCS8 PrivateKey PEM data with password and use the pkg asn1 encode
func (ECDH) CreateECDHPublicKey ¶ added in v1.0.2048
Create PublicKey PEM data and use the pkg asn1 encode
func (ECDH) CreatePrivateKey ¶ added in v1.0.2048
Create PKCS8 PrivateKey PEM data example: obj := New().SetCurve("P256").GenerateKey() priKey := obj.CreatePrivateKey().ToKeyString()
func (ECDH) CreatePrivateKeyWithPassword ¶ added in v1.0.2048
Create PKCS8 PrivateKey PEM data with password CreatePrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (ECDH) CreatePublicKey ¶ added in v1.0.2048
Create PublicKey PEM data
func (ECDH) CreateSecretKey ¶ added in v1.0.2048
Create SecretKey from PrivateKey and PublicKey
func (ECDH) FromECDHPrivateKey ¶ added in v1.0.2048
From ECDH PrivateKey bytes
func (ECDH) FromECDHPrivateKeyDer ¶ added in v1.0.2048
From ECDH PrivateKey Der bytes
func (ECDH) FromECDHPrivateKeyWithPassword ¶ added in v1.0.2048
From ECDH PrivateKey bytes With Password
func (ECDH) FromECDHPublicKey ¶ added in v1.0.2048
From ECDH PublicKey bytes
func (ECDH) FromECDHPublicKeyDer ¶ added in v1.0.2048
From ECDH PublicKey Der bytes
func (ECDH) FromPrivateKey ¶ added in v1.0.2048
From PrivateKey bytes
func (ECDH) FromPrivateKeyDer ¶ added in v1.0.2048
From PrivateKey Der bytes
func (ECDH) FromPrivateKeyWithPassword ¶ added in v1.0.2048
From PrivateKey bytes With Password
func (ECDH) FromPublicKey ¶ added in v1.0.2048
From PublicKey bytes
func (ECDH) FromPublicKeyDer ¶ added in v1.0.2048
From PublicKey Der bytes
func (ECDH) GenerateKeyWithSeed ¶ added in v1.0.2048
GenerateKey With Seed
func (ECDH) GetPrivateKey ¶ added in v1.0.2048
func (this ECDH) GetPrivateKey() *ecdh.PrivateKey
Get PrivateKey
func (ECDH) GetPublicKey ¶ added in v1.0.2048
Get PublicKey
func (ECDH) GetSecretData ¶ added in v1.0.2048
Get secretData
func (ECDH) ParseECDHPrivateKeyFromPEM ¶ added in v1.0.2048
func (this ECDH) ParseECDHPrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error)
Parse ECDH PrivateKey From PEM
func (ECDH) ParseECDHPrivateKeyFromPEMWithPassword ¶ added in v1.0.2048
func (this ECDH) ParseECDHPrivateKeyFromPEMWithPassword(key []byte, password string) (crypto.PrivateKey, error)
Parse ECDH PrivateKey From PEM With Password
func (ECDH) ParseECDHPublicKeyFromPEM ¶ added in v1.0.2048
Parse ECDH PublicKey From PEM
func (ECDH) ParsePrivateKeyFromPEM ¶ added in v1.0.2048
func (this ECDH) ParsePrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error)
Parse PrivateKey From PEM
func (ECDH) ParsePrivateKeyFromPEMWithPassword ¶ added in v1.0.2048
func (this ECDH) ParsePrivateKeyFromPEMWithPassword(key []byte, password string) (crypto.PrivateKey, error)
Parse PrivateKey From PEM With Password
func (ECDH) ParsePublicKeyFromPEM ¶ added in v1.0.2048
Parse PublicKey From PEM
func (ECDH) SetCurve ¶ added in v1.0.2048
set curve type string params [P521 | P384 | P256 | X25519]
func (ECDH) ToBase64String ¶ added in v1.0.2048
output base64 data
func (ECDH) ToKeyBytes ¶ added in v1.0.2048
output key bytes data
func (ECDH) ToKeyString ¶ added in v1.0.2048
output key string data
func (ECDH) WithErrors ¶ added in v1.0.2048
set error list
func (ECDH) WithKeyData ¶ added in v1.0.2048
set keyData
func (ECDH) WithPrivateKey ¶ added in v1.0.2048
func (this ECDH) WithPrivateKey(data *ecdh.PrivateKey) ECDH
set PrivateKey
func (ECDH) WithPublicKey ¶ added in v1.0.2048
set PublicKey
func (ECDH) WithSecretData ¶ added in v1.0.2048
set secretData