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 = pkcs8.GetCipherFromName // 获取 hash 类型 GetHashFromName = pkcs8.GetHashFromName )
Functions ¶
This section is empty.
Types ¶
type ECDH ¶ added in v1.0.2048
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 ¶ added in v1.0.2048
生成私钥 pem 数据 使用: obj := New().GenerateKey("P2048") priKey := obj.CreatePrivateKey().ToKeyString()
func (ECDH) CreatePrivateKeyWithPassword ¶ added in v1.0.2048
生成 PKCS8 私钥带密码 pem 数据 CreatePrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (ECDH) CreatePublicKey ¶ added in v1.0.2048
生成公钥 pem 数据
func (ECDH) CreateSecretKey ¶ added in v1.0.2048
根据公钥和私钥生成密钥
func (ECDH) FromKeyXYHexString ¶ added in v1.0.2048
根据私钥 x, y 生成
func (ECDH) FromPrivateKeyDer ¶ added in v1.0.2048
DER 私钥
func (ECDH) FromPrivateKeyWithPassword ¶ added in v1.0.2048
私钥带密码
func (ECDH) FromPrivateKeyXHexString ¶ added in v1.0.2048
根据私钥 x 生成
func (ECDH) FromPublicKeyDer ¶ added in v1.0.2048
DER 公钥
func (ECDH) FromPublicKeyYHexString ¶ added in v1.0.2048
根据公钥 y 生成
func (ECDH) GenerateKeyWithSeed ¶ added in v1.0.2048
生成密钥
func (ECDH) GetPrivateKey ¶ added in v1.0.2048
func (this ECDH) GetPrivateKey() *ecdh.PrivateKey
获取 PrivateKey
func (ECDH) GetPrivateKeyXHexString ¶ added in v1.0.2048
获取 X 16进制字符
func (ECDH) GetPublicKey ¶ added in v1.0.2048
获取 PublicKey
func (ECDH) GetPublicKeyYHexString ¶ added in v1.0.2048
获取 Y 16进制字符
func (ECDH) GetSecretData ¶ added in v1.0.2048
获取 secretData
func (ECDH) ParsePrivateKeyFromPEM ¶ added in v1.0.2048
func (this ECDH) ParsePrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error)
解析私钥
func (ECDH) ParsePrivateKeyFromPEMWithPassword ¶ added in v1.0.2048
func (this ECDH) ParsePrivateKeyFromPEMWithPassword(key []byte, password string) (crypto.PrivateKey, error)
解析私钥带密码
func (ECDH) ParsePublicKeyFromPEM ¶ added in v1.0.2048
解析公钥
func (ECDH) WithKeyData ¶ added in v1.0.2048
设置 keyData
func (ECDH) WithPrivateKey ¶ added in v1.0.2048
func (this ECDH) WithPrivateKey(data *ecdh.PrivateKey) ECDH
设置 PrivateKey
func (ECDH) WithPublicKey ¶ added in v1.0.2048
设置 PublicKey
func (ECDH) WithSecretData ¶ added in v1.0.2048
设置 secretData
Click to show internal directories.
Click to hide internal directories.