Documentation ¶
Index ¶
- Variables
- type Curve25519
- func FromKeyXYString(xString string, yString string) Curve25519
- func FromPrivateKey(key []byte) Curve25519
- func FromPrivateKeyWithPassword(key []byte, password string) Curve25519
- func FromPrivateKeyXString(xString string) Curve25519
- func FromPublicKey(key []byte) Curve25519
- func FromPublicKeyYString(yString string) Curve25519
- func GenerateKey() Curve25519
- func GenerateKeyWithSeed(reader io.Reader) Curve25519
- func New() Curve25519
- func NewCurve25519() Curve25519
- func (this Curve25519) AppendError(err ...error) Curve25519
- func (this Curve25519) CheckKeyPair() bool
- func (this Curve25519) CreatePrivateKey() Curve25519
- func (this Curve25519) CreatePrivateKeyWithPassword(password string, opts ...any) Curve25519
- func (this Curve25519) CreatePublicKey() Curve25519
- func (this Curve25519) CreateSecretKey() Curve25519
- func (this Curve25519) Error() error
- func (this Curve25519) FromKeyXYString(xString string, yString string) Curve25519
- func (this Curve25519) FromPrivateKey(key []byte) Curve25519
- func (this Curve25519) FromPrivateKeyDer(der []byte) Curve25519
- func (this Curve25519) FromPrivateKeyWithPassword(key []byte, password string) Curve25519
- func (this Curve25519) FromPrivateKeyXString(xString string) Curve25519
- func (this Curve25519) FromPublicKey(key []byte) Curve25519
- func (this Curve25519) FromPublicKeyDer(der []byte) Curve25519
- func (this Curve25519) FromPublicKeyYString(yString string) Curve25519
- func (this Curve25519) GenerateKey() Curve25519
- func (this Curve25519) GenerateKeyWithSeed(reader io.Reader) Curve25519
- func (this Curve25519) GetErrors() []error
- func (this Curve25519) GetKeyData() []byte
- func (this Curve25519) GetPrivateKey() *curve25519.PrivateKey
- func (this Curve25519) GetPrivateKeyXString() string
- func (this Curve25519) GetPublicKey() *curve25519.PublicKey
- func (this Curve25519) GetPublicKeyYString() string
- func (this Curve25519) GetSecretData() []byte
- func (this Curve25519) MakeKeyDer() Curve25519
- func (this Curve25519) MakePublicKey() Curve25519
- func (this Curve25519) OnError(fn ErrorFunc) Curve25519
- func (this Curve25519) ParsePrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error)
- func (this Curve25519) ParsePrivateKeyFromPEMWithPassword(key []byte, password string) (crypto.PrivateKey, error)
- func (this Curve25519) ParsePublicKeyFromPEM(key []byte) (crypto.PublicKey, error)
- func (this Curve25519) ToBase64String() string
- func (this Curve25519) ToBytes() []byte
- func (this Curve25519) ToHexString() string
- func (this Curve25519) ToKeyBytes() []byte
- func (this Curve25519) ToKeyString() string
- func (this Curve25519) ToString() string
- func (this Curve25519) WithErrors(errs []error) Curve25519
- func (this Curve25519) WithKeyData(data []byte) Curve25519
- func (this Curve25519) WithPrivateKey(data *curve25519.PrivateKey) Curve25519
- func (this Curve25519) WithPublicKey(data *curve25519.PublicKey) Curve25519
- func (this Curve25519) WithSecretData(data []byte) Curve25519
- 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 Curve25519 ¶
type Curve25519 struct { // 错误 Errors []error // contains filtered or unexported fields }
*
- curve25519 *
- @create 2022-8-7
- @author deatil
func FromKeyXYString ¶ added in v1.0.2071
func FromKeyXYString(xString string, yString string) Curve25519
根据私钥 x, y 生成
func FromPrivateKeyWithPassword ¶ added in v1.0.2014
func FromPrivateKeyWithPassword(key []byte, password string) Curve25519
私钥
func FromPrivateKeyXString ¶ added in v1.0.2071
func FromPrivateKeyXString(xString string) Curve25519
根据私钥 x 生成
func FromPublicKeyYString ¶ added in v1.0.2071
func FromPublicKeyYString(yString string) Curve25519
根据公钥 y 生成
func GenerateKeyWithSeed ¶ added in v1.0.2026
func GenerateKeyWithSeed(reader io.Reader) Curve25519
生成密钥
func (Curve25519) AppendError ¶ added in v1.0.1026
func (this Curve25519) AppendError(err ...error) Curve25519
添加错误
func (Curve25519) CheckKeyPair ¶ added in v1.0.1046
func (this Curve25519) CheckKeyPair() bool
检测公钥私钥是否匹配
func (Curve25519) CreatePrivateKey ¶
func (this Curve25519) CreatePrivateKey() Curve25519
生成私钥 pem 数据 使用: obj := New().GenerateKey("P2048") priKey := obj.CreatePrivateKey().ToKeyString()
func (Curve25519) CreatePrivateKeyWithPassword ¶
func (this Curve25519) CreatePrivateKeyWithPassword(password string, opts ...any) Curve25519
生成 PKCS8 私钥带密码 pem 数据 CreatePrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (Curve25519) CreateSecretKey ¶ added in v1.0.1038
func (this Curve25519) CreateSecretKey() Curve25519
根据公钥和私钥生成密钥
func (Curve25519) FromKeyXYString ¶ added in v1.0.2071
func (this Curve25519) FromKeyXYString(xString string, yString string) Curve25519
根据私钥 x, y 生成
func (Curve25519) FromPrivateKeyDer ¶ added in v1.0.2015
func (this Curve25519) FromPrivateKeyDer(der []byte) Curve25519
DER 私钥
func (Curve25519) FromPrivateKeyWithPassword ¶
func (this Curve25519) FromPrivateKeyWithPassword(key []byte, password string) Curve25519
私钥带密码
func (Curve25519) FromPrivateKeyXString ¶ added in v1.0.2071
func (this Curve25519) FromPrivateKeyXString(xString string) Curve25519
根据私钥 x 生成
func (Curve25519) FromPublicKeyDer ¶ added in v1.0.2015
func (this Curve25519) FromPublicKeyDer(der []byte) Curve25519
DER 公钥
func (Curve25519) FromPublicKeyYString ¶ added in v1.0.2071
func (this Curve25519) FromPublicKeyYString(yString string) Curve25519
根据公钥 y 生成
func (Curve25519) GenerateKeyWithSeed ¶ added in v1.0.2026
func (this Curve25519) GenerateKeyWithSeed(reader io.Reader) Curve25519
生成密钥
func (Curve25519) GetPrivateKey ¶
func (this Curve25519) GetPrivateKey() *curve25519.PrivateKey
获取 PrivateKey
func (Curve25519) GetPrivateKeyXString ¶ added in v1.0.2071
func (this Curve25519) GetPrivateKeyXString() string
获取 X 16进制字符
func (Curve25519) GetPublicKey ¶
func (this Curve25519) GetPublicKey() *curve25519.PublicKey
获取 PublicKey
func (Curve25519) GetPublicKeyYString ¶ added in v1.0.2071
func (this Curve25519) GetPublicKeyYString() string
获取 Y 16进制字符
func (Curve25519) GetSecretData ¶ added in v1.0.1026
func (this Curve25519) GetSecretData() []byte
获取 secretData
func (Curve25519) MakeKeyDer ¶ added in v1.0.1033
func (this Curve25519) MakeKeyDer() Curve25519
生成密钥 der 数据
func (Curve25519) ParsePrivateKeyFromPEM ¶
func (this Curve25519) ParsePrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error)
解析私钥
func (Curve25519) ParsePrivateKeyFromPEMWithPassword ¶
func (this Curve25519) ParsePrivateKeyFromPEMWithPassword(key []byte, password string) (crypto.PrivateKey, error)
解析私钥带密码
func (Curve25519) ParsePublicKeyFromPEM ¶
func (this Curve25519) ParsePublicKeyFromPEM(key []byte) (crypto.PublicKey, error)
解析公钥
func (Curve25519) WithErrors ¶ added in v1.0.1026
func (this Curve25519) WithErrors(errs []error) Curve25519
设置错误
func (Curve25519) WithKeyData ¶
func (this Curve25519) WithKeyData(data []byte) Curve25519
设置 keyData
func (Curve25519) WithPrivateKey ¶
func (this Curve25519) WithPrivateKey(data *curve25519.PrivateKey) Curve25519
设置 PrivateKey
func (Curve25519) WithPublicKey ¶
func (this Curve25519) WithPublicKey(data *curve25519.PublicKey) Curve25519
设置 PublicKey
func (Curve25519) WithSecretData ¶ added in v1.0.1026
func (this Curve25519) WithSecretData(data []byte) Curve25519
设置 secretData
Click to show internal directories.
Click to hide internal directories.