Documentation ¶
Index ¶
- Variables
- func RandomString(n int64, allowedChars ...[]rune) string
- type Dh
- func (this Dh) AppendError(err ...error) Dh
- func (this Dh) CheckKeyPair() bool
- func (this Dh) CreatePrivateKey() Dh
- func (this Dh) CreatePrivateKeyWithPassword(password string, opts ...any) Dh
- func (this Dh) CreatePublicKey() Dh
- func (this Dh) CreateSecretKey() Dh
- func (this Dh) Error() error
- func (this Dh) FromKeyXYHexString(xString string, yString string) Dh
- func (this Dh) FromPrivateKey(key []byte) Dh
- func (this Dh) FromPrivateKeyWithPassword(key []byte, password string) Dh
- func (this Dh) FromPrivateKeyXHexString(xString string) Dh
- func (this Dh) FromPublicKey(key []byte) Dh
- func (this Dh) FromPublicKeyYHexString(yString string) Dh
- func (this Dh) GenerateKey() Dh
- func (this Dh) GetErrors() []error
- func (this Dh) GetGroup() *dh.Group
- func (this Dh) GetKeyData() []byte
- func (this Dh) GetPrivateKey() *dh.PrivateKey
- func (this Dh) GetPrivateKeyXHexString() string
- func (this Dh) GetPublicKey() *dh.PublicKey
- func (this Dh) GetPublicKeyParametersGHexString() string
- func (this Dh) GetPublicKeyParametersPHexString() string
- func (this Dh) GetPublicKeyYHexString() string
- func (this Dh) GetSecretData() []byte
- func (this Dh) MakeKeyDer() Dh
- func (this Dh) MakePublicKey() Dh
- func (this Dh) OnError(fn ErrorFunc) Dh
- func (this Dh) ParsePrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error)
- func (this Dh) ParsePrivateKeyFromPEMWithPassword(key []byte, password string) (crypto.PrivateKey, error)
- func (this Dh) ParsePublicKeyFromPEM(key []byte) (crypto.PublicKey, error)
- func (this Dh) SetGroup(name string) Dh
- func (this Dh) SetGroupPG(p string, g int64) Dh
- func (this Dh) SetRandGroup(num int64) Dh
- func (this Dh) ToBase64String() string
- func (this Dh) ToBytes() []byte
- func (this Dh) ToHexString() string
- func (this Dh) ToKeyBytes() []byte
- func (this Dh) ToKeyString() string
- func (this Dh) ToString() string
- func (this Dh) WithError(errs []error) Dh
- func (this Dh) WithGroup(data *dh.Group) Dh
- func (this Dh) WithKeyData(data []byte) Dh
- func (this Dh) WithPrivateKey(data *dh.PrivateKey) Dh
- func (this Dh) WithPublicKey(data *dh.PublicKey) Dh
- func (this Dh) WithSecretData(data []byte) Dh
- type ErrorFunc
- type Group
- 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 ¶
func RandomString ¶ added in v1.0.1028
生成随机字符
Types ¶
type Dh ¶
type Dh struct { // 错误 Errors []error // contains filtered or unexported fields }
*
- dh *
- @create 2022-8-7
- @author deatil
func (Dh) CreatePrivateKey ¶
生成私钥 pem 数据 使用: obj := New().GenerateKey("P2048") priKey := obj.CreatePrivateKey().ToKeyString()
func (Dh) CreatePrivateKeyWithPassword ¶
生成 PKCS8 私钥带密码 pem 数据 CreatePrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (Dh) FromKeyXYHexString ¶ added in v1.0.1025
根据密钥 x, y 生成
func (Dh) FromPrivateKeyWithPassword ¶
私钥带密码
func (Dh) FromPrivateKeyXHexString ¶ added in v1.0.1025
根据私钥 x 生成
func (Dh) FromPublicKeyYHexString ¶ added in v1.0.1025
根据公钥 y 生成
func (Dh) GetPrivateKeyXHexString ¶ added in v1.0.1025
获取 X 16进制字符
func (Dh) GetPublicKeyParametersGHexString ¶ added in v1.0.1025
获取 G 16进制字符
func (Dh) GetPublicKeyParametersPHexString ¶ added in v1.0.1025
获取 P 16进制字符
func (Dh) GetPublicKeyYHexString ¶ added in v1.0.1025
获取 Y 16进制字符
func (Dh) ParsePrivateKeyFromPEM ¶
func (this Dh) ParsePrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error)
解析私钥
func (Dh) ParsePrivateKeyFromPEMWithPassword ¶
func (this Dh) ParsePrivateKeyFromPEMWithPassword(key []byte, password string) (crypto.PrivateKey, error)
解析私钥带密码
func (Dh) ParsePublicKeyFromPEM ¶
解析公钥
func (Dh) SetGroupPG ¶ added in v1.0.1027
根据 Group P和G 数据设置分组
func (Dh) WithSecretData ¶ added in v1.0.1026
设置 secretData
Click to show internal directories.
Click to hide internal directories.