Documentation ¶
Index ¶
- Variables
- type Ecdh
- func FromKeyXYHexString(xString string, yString string) Ecdh
- func FromPrivateKey(key []byte) Ecdh
- func FromPrivateKeyWithPassword(key []byte, password string) Ecdh
- func FromPrivateKeyXHexString(xString string) Ecdh
- func FromPublicKey(key []byte) Ecdh
- func FromPublicKeyYHexString(yString string) 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) 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) FromKeyXYHexString(xString string, yString string) 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) FromPrivateKeyXHexString(xString string) Ecdh
- func (this Ecdh) FromPublicKey(key []byte) Ecdh
- func (this Ecdh) FromPublicKeyDer(der []byte) Ecdh
- func (this Ecdh) FromPublicKeyYHexString(yString string) 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) GetPrivateKeyXHexString() string
- func (this Ecdh) GetPublicKey() *ecdh.PublicKey
- func (this Ecdh) GetPublicKeyYHexString() string
- 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 *
- @create 2022-8-7
- @author deatil
func FromKeyXYHexString ¶ added in v1.0.2014
根据私钥 x, y 生成
func FromPrivateKeyWithPassword ¶ added in v1.0.2014
私钥
func FromPrivateKeyXHexString ¶ added in v1.0.2014
根据私钥 x 生成
func FromPublicKeyYHexString ¶ added in v1.0.2014
根据公钥 y 生成
func GenerateKey ¶ added in v1.0.2014
生成密钥 可用参数 [P521 | P384 | P256 | P224]
func GenerateKeyWithSeed ¶ added in v1.0.2026
生成密钥 可用参数 [P521 | P384 | P256 | P224]
func (Ecdh) CreatePrivateKey ¶
生成私钥 pem 数据 使用: obj := New().GenerateKey("P2048") priKey := obj.CreatePrivateKey().ToKeyString()
func (Ecdh) CreatePrivateKeyWithPassword ¶
生成 PKCS8 私钥带密码 pem 数据 CreatePrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (Ecdh) CreateSecretKey ¶ added in v1.0.1038
根据公钥和私钥生成密钥
func (Ecdh) FromKeyXYHexString ¶ added in v1.0.1025
根据私钥 x, y 生成
func (Ecdh) FromPrivateKeyDer ¶ added in v1.0.2015
DER 私钥
func (Ecdh) FromPrivateKeyWithPassword ¶
私钥带密码
func (Ecdh) FromPrivateKeyXHexString ¶ added in v1.0.1025
根据私钥 x 生成
func (Ecdh) FromPublicKeyDer ¶ added in v1.0.2015
DER 公钥
func (Ecdh) FromPublicKeyYHexString ¶ added in v1.0.1025
根据公钥 y 生成
func (Ecdh) GenerateKeyWithSeed ¶ added in v1.0.2026
生成密钥
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.