Documentation ¶
Index ¶
- Variables
- func RandomString(n int64, allowedChars ...[]rune) string
- type DH
- func FromKeyXYString(xString string, yString string) DH
- func FromPrivateKey(key []byte) DH
- func FromPrivateKeyWithPassword(key []byte, password string) DH
- func FromPrivateKeyXString(xString string) DH
- func FromPublicKey(key []byte) DH
- func FromPublicKeyYString(yString string) DH
- func GenerateKey(name string) DH
- func GenerateKeyWithSeed(reader io.Reader, name string) DH
- func New() DH
- func NewDH() 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) FromKeyXYString(xString string, yString string) DH
- func (this DH) FromPrivateKey(key []byte) DH
- func (this DH) FromPrivateKeyDer(der []byte) DH
- func (this DH) FromPrivateKeyWithPassword(key []byte, password string) DH
- func (this DH) FromPrivateKeyXString(xString string) DH
- func (this DH) FromPublicKey(key []byte) DH
- func (this DH) FromPublicKeyDer(der []byte) DH
- func (this DH) FromPublicKeyYString(yString string) DH
- func (this DH) GenerateKey() DH
- func (this DH) GenerateKeyWithSeed(reader io.Reader) 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) GetPrivateKeyXString() string
- func (this DH) GetPublicKey() *dh.PublicKey
- func (this DH) GetPublicKeyParametersGString() string
- func (this DH) GetPublicKeyParametersPString() string
- func (this DH) GetPublicKeyYString() 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 = pkcs8.GetCipherFromName // 获取 hash 类型 GetHashFromName = pkcs8.GetHashFromName )
Functions ¶
func RandomString ¶ added in v1.0.1028
生成随机字符
Types ¶
type DH ¶ added in v1.0.2048
type DH struct { // 错误 Errors []error // contains filtered or unexported fields }
*
- dh *
- @create 2022-8-7
- @author deatil
func FromKeyXYString ¶ added in v1.0.2071
根据私钥 x, y 生成
func FromPrivateKeyWithPassword ¶ added in v1.0.2014
私钥
func FromPrivateKeyXString ¶ added in v1.0.2071
根据私钥 x 生成
func FromPublicKeyYString ¶ added in v1.0.2071
根据公钥 y 生成
func GenerateKeyWithSeed ¶ added in v1.0.2026
生成密钥
func (DH) CreatePrivateKey ¶ added in v1.0.2048
生成私钥 pem 数据 使用: obj := New().GenerateKey("P2048") priKey := obj.CreatePrivateKey().ToKeyString()
func (DH) CreatePrivateKeyWithPassword ¶ added in v1.0.2048
生成 PKCS8 私钥带密码 pem 数据 CreatePrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (DH) FromKeyXYString ¶ added in v1.0.2071
根据密钥 x, y 生成
func (DH) FromPrivateKeyDer ¶ added in v1.0.2048
DER 私钥
func (DH) FromPrivateKeyWithPassword ¶ added in v1.0.2048
私钥带密码
func (DH) FromPrivateKeyXString ¶ added in v1.0.2071
根据私钥 x 生成
func (DH) FromPublicKeyDer ¶ added in v1.0.2048
DER 公钥
func (DH) FromPublicKeyYString ¶ added in v1.0.2071
根据公钥 y 生成
func (DH) GenerateKeyWithSeed ¶ added in v1.0.2048
生成密钥
func (DH) GetPrivateKey ¶ added in v1.0.2048
func (this DH) GetPrivateKey() *dh.PrivateKey
获取 PrivateKey
func (DH) GetPrivateKeyXString ¶ added in v1.0.2071
获取 X 16进制字符
func (DH) GetPublicKey ¶ added in v1.0.2048
获取 PublicKey
func (DH) GetPublicKeyParametersGString ¶ added in v1.0.2071
获取 G 16进制字符
func (DH) GetPublicKeyParametersPString ¶ added in v1.0.2071
获取 P 16进制字符
func (DH) GetPublicKeyYString ¶ added in v1.0.2071
获取 Y 16进制字符
func (DH) ParsePrivateKeyFromPEM ¶ added in v1.0.2048
func (this DH) ParsePrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error)
解析私钥
func (DH) ParsePrivateKeyFromPEMWithPassword ¶ added in v1.0.2048
func (this DH) ParsePrivateKeyFromPEMWithPassword(key []byte, password string) (crypto.PrivateKey, error)
解析私钥带密码
func (DH) ParsePublicKeyFromPEM ¶ added in v1.0.2048
解析公钥
func (DH) SetGroupPG ¶ added in v1.0.2048
根据 Group P和G 数据设置分组
func (DH) WithPrivateKey ¶ added in v1.0.2048
func (this DH) WithPrivateKey(data *dh.PrivateKey) DH
设置 PrivateKey
func (DH) WithPublicKey ¶ added in v1.0.2048
设置 PublicKey
func (DH) WithSecretData ¶ added in v1.0.2048
设置 secretData
Click to show internal directories.
Click to hide internal directories.