Documentation ¶
Index ¶
- Variables
- type Ecdsa
- func FromBase64String(data string) Ecdsa
- func FromBytes(data []byte) Ecdsa
- func FromHexString(data string) Ecdsa
- func FromPKCS1PrivateKey(key []byte) Ecdsa
- func FromPKCS1PrivateKeyWithPassword(key []byte, password string) Ecdsa
- func FromPKCS8PrivateKey(key []byte) Ecdsa
- func FromPKCS8PrivateKeyWithPassword(key []byte, password string) Ecdsa
- func FromPrivateKey(key []byte) Ecdsa
- func FromPrivateKeyWithPassword(key []byte, password string) Ecdsa
- func FromPublicKey(key []byte) Ecdsa
- func FromString(data string) Ecdsa
- func GenerateKey(curve string) Ecdsa
- func GenerateKeyWithSeed(reader io.Reader, curve string) Ecdsa
- func New() Ecdsa
- func NewEcdsa() Ecdsa
- func (this Ecdsa) AppendError(err ...error) Ecdsa
- func (this Ecdsa) CheckKeyPair() bool
- func (this Ecdsa) CreatePKCS1PrivateKey() Ecdsa
- func (this Ecdsa) CreatePKCS1PrivateKeyWithPassword(password string, opts ...string) Ecdsa
- func (this Ecdsa) CreatePKCS8PrivateKey() Ecdsa
- func (this Ecdsa) CreatePKCS8PrivateKeyWithPassword(password string, opts ...any) Ecdsa
- func (this Ecdsa) CreatePrivateKey() Ecdsa
- func (this Ecdsa) CreatePrivateKeyWithPassword(password string, opts ...string) Ecdsa
- func (this Ecdsa) CreatePublicKey() Ecdsa
- func (this Ecdsa) DataHash(fn HashFunc, data []byte) ([]byte, error)
- func (this Ecdsa) Decrypt() Ecdsa
- func (this Ecdsa) Encrypt() Ecdsa
- func (this Ecdsa) Error() error
- func (this Ecdsa) FromBase64String(data string) Ecdsa
- func (this Ecdsa) FromBytes(data []byte) Ecdsa
- func (this Ecdsa) FromHexString(data string) Ecdsa
- func (this Ecdsa) FromPKCS1PrivateKey(key []byte) Ecdsa
- func (this Ecdsa) FromPKCS1PrivateKeyDer(der []byte) Ecdsa
- func (this Ecdsa) FromPKCS1PrivateKeyWithPassword(key []byte, password string) Ecdsa
- func (this Ecdsa) FromPKCS8PrivateKey(key []byte) Ecdsa
- func (this Ecdsa) FromPKCS8PrivateKeyDer(der []byte) Ecdsa
- func (this Ecdsa) FromPKCS8PrivateKeyWithPassword(key []byte, password string) Ecdsa
- func (this Ecdsa) FromPrivateKey(key []byte) Ecdsa
- func (this Ecdsa) FromPrivateKeyBytes(priByte []byte) Ecdsa
- func (this Ecdsa) FromPrivateKeyString(keyString string) Ecdsa
- func (this Ecdsa) FromPrivateKeyWithPassword(key []byte, password string) Ecdsa
- func (this Ecdsa) FromPublicKey(key []byte) Ecdsa
- func (this Ecdsa) FromPublicKeyBytes(pub []byte) Ecdsa
- func (this Ecdsa) FromPublicKeyCompressString(key string) Ecdsa
- func (this Ecdsa) FromPublicKeyDer(der []byte) Ecdsa
- func (this Ecdsa) FromPublicKeyString(key string) Ecdsa
- func (this Ecdsa) FromPublicKeyUncompressString(key string) Ecdsa
- func (this Ecdsa) FromPublicKeyXYBytes(xBytes, yBytes []byte) Ecdsa
- func (this Ecdsa) FromPublicKeyXYString(xString string, yString string) Ecdsa
- func (this Ecdsa) FromString(data string) Ecdsa
- func (this Ecdsa) GenerateKey() Ecdsa
- func (this Ecdsa) GenerateKeyWithSeed(reader io.Reader) Ecdsa
- func (this Ecdsa) GetData() []byte
- func (this Ecdsa) GetErrors() []error
- func (this Ecdsa) GetKeyData() []byte
- func (this Ecdsa) GetParedData() []byte
- func (this Ecdsa) GetPrivateKey() *ecdsa.PrivateKey
- func (this Ecdsa) GetPrivateKeyCurve() elliptic.Curve
- func (this Ecdsa) GetPrivateKeyDHexString() string
- func (this Ecdsa) GetPrivateKeyString() string
- func (this Ecdsa) GetPublicKey() *ecdsa.PublicKey
- func (this Ecdsa) GetPublicKeyCompressString() string
- func (this Ecdsa) GetPublicKeyCurve() elliptic.Curve
- func (this Ecdsa) GetPublicKeyUncompressString() string
- func (this Ecdsa) GetPublicKeyXHexString() string
- func (this Ecdsa) GetPublicKeyXYHexString() string
- func (this Ecdsa) GetPublicKeyYHexString() string
- func (this Ecdsa) GetSignHash() HashFunc
- func (this Ecdsa) GetVerify() bool
- func (this Ecdsa) MakeKeyDer() Ecdsa
- func (this Ecdsa) MakePublicKey() Ecdsa
- func (this Ecdsa) OnError(fn EcdsaErrorFunc) Ecdsa
- func (this Ecdsa) ParsePKCS1PrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error)
- func (this Ecdsa) ParsePKCS1PrivateKeyFromPEMWithPassword(key []byte, password string) (*ecdsa.PrivateKey, error)
- func (this Ecdsa) ParsePKCS8PrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error)
- func (this Ecdsa) ParsePKCS8PrivateKeyFromPEMWithPassword(key []byte, password string) (*ecdsa.PrivateKey, error)
- func (this Ecdsa) ParsePublicKeyFromPEM(key []byte) (*ecdsa.PublicKey, error)
- func (this Ecdsa) SetCurve(curve string) Ecdsa
- func (this Ecdsa) SetSignHash(hash string) Ecdsa
- func (this Ecdsa) Sign(separator ...string) Ecdsa
- func (this Ecdsa) SignASN1() Ecdsa
- func (this Ecdsa) SignBytes() Ecdsa
- func (this Ecdsa) ToBase64String() string
- func (this Ecdsa) ToBytes() []byte
- func (this Ecdsa) ToHexString() string
- func (this Ecdsa) ToKeyBytes() []byte
- func (this Ecdsa) ToKeyString() string
- func (this Ecdsa) ToString() string
- func (this Ecdsa) ToVerify() bool
- func (this Ecdsa) ToVerifyInt() int
- func (this Ecdsa) Verify(data []byte, separator ...string) Ecdsa
- func (this Ecdsa) VerifyASN1(data []byte) Ecdsa
- func (this Ecdsa) VerifyBytes(data []byte) Ecdsa
- func (this Ecdsa) WithCurve(curve elliptic.Curve) Ecdsa
- func (this Ecdsa) WithData(data []byte) Ecdsa
- func (this Ecdsa) WithErrors(errs []error) Ecdsa
- func (this Ecdsa) WithParedData(data []byte) Ecdsa
- func (this Ecdsa) WithPrivateKey(data *ecdsa.PrivateKey) Ecdsa
- func (this Ecdsa) WithPublicKey(data *ecdsa.PublicKey) Ecdsa
- func (this Ecdsa) WithSignHash(hash HashFunc) Ecdsa
- func (this Ecdsa) WithVerify(data bool) Ecdsa
- type EcdsaErrorFunc
- type HashFunc
- type Opts
- type PBKDF2Opts
- type ScryptOpts
Constants ¶
This section is empty.
Variables ¶
var ( // 获取 Cipher 类型 GetCipherFromName = cryptobin_pkcs8.GetCipherFromName // 获取 hash 类型 GetHashFromName = cryptobin_pkcs8.GetHashFromName )
Functions ¶
This section is empty.
Types ¶
type Ecdsa ¶
type Ecdsa struct { // 错误 Errors []error // contains filtered or unexported fields }
*
- Ecdsa *
- @create 2022-4-3
- @author deatil
func FromPKCS1PrivateKeyWithPassword ¶ added in v1.0.2015
私钥带密码
func FromPKCS8PrivateKeyWithPassword ¶ added in v1.0.1018
PKCS8 私钥带密码
func FromPrivateKeyWithPassword ¶ added in v1.0.1018
私钥
func GenerateKey ¶ added in v1.0.1018
生成密钥 可选 [P521 | P384 | P256 | P224]
func GenerateKeyWithSeed ¶ added in v1.0.2026
生成密钥 可选 [P521 | P384 | P256 | P224]
func (Ecdsa) AppendError ¶ added in v1.0.1026
添加错误
func (Ecdsa) CreatePKCS1PrivateKey ¶ added in v1.0.1028
生成私钥 pem 数据
func (Ecdsa) CreatePKCS1PrivateKeyWithPassword ¶ added in v1.0.1028
生成私钥带密码 pem 数据
func (Ecdsa) CreatePKCS8PrivateKey ¶
生成 PKCS8 私钥 pem 数据
func (Ecdsa) CreatePKCS8PrivateKeyWithPassword ¶
生成 PKCS8 私钥带密码 pem 数据 CreatePKCS8PrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (Ecdsa) CreatePrivateKey ¶
生成私钥 pem 数据, PKCS1 别名 使用: obj := New().WithCurve("P521").GenerateKey() priKey := obj.CreatePrivateKey().ToKeyString()
func (Ecdsa) CreatePrivateKeyWithPassword ¶
生成私钥带密码 pem 数据, PKCS1 别名 CreatePrivateKeyWithPassword("123", "AES256CBC") PEMCipher: DESCBC | DESEDE3CBC | AES128CBC | AES192CBC | AES256CBC
func (Ecdsa) FromPKCS1PrivateKey ¶ added in v1.0.2014
私钥
func (Ecdsa) FromPKCS1PrivateKeyDer ¶ added in v1.0.2015
DER 私钥
func (Ecdsa) FromPKCS1PrivateKeyWithPassword ¶ added in v1.0.2014
私钥带密码
func (Ecdsa) FromPKCS8PrivateKeyDer ¶ added in v1.0.2015
DER 私钥
func (Ecdsa) FromPKCS8PrivateKeyWithPassword ¶
Pkcs8WithPassword
func (Ecdsa) FromPrivateKeyBytes ¶
明文私钥生成私钥结构体 需要设置对应的 curve
func (Ecdsa) FromPrivateKeyString ¶
私钥明文,需要设置对应的 curve private-key: 07e4********;
func (Ecdsa) FromPrivateKeyWithPassword ¶
私钥带密码
func (Ecdsa) FromPublicKeyBytes ¶ added in v1.0.2031
公钥明文, hex 或者 base64 解码后 需要设置对应的 curve
func (Ecdsa) FromPublicKeyCompressString ¶ added in v1.0.2031
公钥明文压缩 需要设置对应的 curve public-key hex: 027c******** || 036c********
func (Ecdsa) FromPublicKeyDer ¶ added in v1.0.2015
DER 公钥
func (Ecdsa) FromPublicKeyString ¶
公钥明文,需要设置对应的 curve
func (Ecdsa) FromPublicKeyUncompressString ¶ added in v1.0.2031
公钥明文未压缩 需要设置对应的 curve public-key hex: 047c********.
func (Ecdsa) FromPublicKeyXYBytes ¶
公钥字符对,需要设置对应的 curve
func (Ecdsa) FromPublicKeyXYString ¶ added in v1.0.1018
公钥 x,y 16进制字符对 需要设置对应的 curve [xString: xHexString, yString: yHexString]
func (Ecdsa) GenerateKeyWithSeed ¶ added in v1.0.2026
生成密钥
func (Ecdsa) GetPrivateKeyCurve ¶
获取 PrivateKeyCurve
func (Ecdsa) GetPrivateKeyDHexString ¶ added in v1.0.1018
获取 PrivateKeyD
func (Ecdsa) GetPrivateKeyString ¶ added in v1.0.2031
获取私钥明文
func (Ecdsa) GetPublicKeyCompressString ¶ added in v1.0.2031
获取压缩公钥
func (Ecdsa) GetPublicKeyCurve ¶
获取 PublicKeyCurve
func (Ecdsa) GetPublicKeyUncompressString ¶ added in v1.0.2031
获取未压缩公钥
func (Ecdsa) GetPublicKeyXHexString ¶ added in v1.0.1018
获取 PublicKeyX
func (Ecdsa) GetPublicKeyXYHexString ¶ added in v1.0.2031
获取 PublicKeyXYHex
func (Ecdsa) GetPublicKeyYHexString ¶ added in v1.0.1018
获取 PublicKeyY
func (Ecdsa) ParsePKCS1PrivateKeyFromPEM ¶ added in v1.0.2014
func (this Ecdsa) ParsePKCS1PrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error)
解析私钥
func (Ecdsa) ParsePKCS1PrivateKeyFromPEMWithPassword ¶ added in v1.0.2014
func (this Ecdsa) ParsePKCS1PrivateKeyFromPEMWithPassword(key []byte, password string) (*ecdsa.PrivateKey, error)
解析私钥带密码
func (Ecdsa) ParsePKCS8PrivateKeyFromPEM ¶ added in v1.0.2014
func (this Ecdsa) ParsePKCS8PrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error)
解析私钥
func (Ecdsa) ParsePKCS8PrivateKeyFromPEMWithPassword ¶ added in v1.0.1043
func (this Ecdsa) ParsePKCS8PrivateKeyFromPEMWithPassword(key []byte, password string) (*ecdsa.PrivateKey, error)
解析 PKCS8 带密码的私钥
func (Ecdsa) ParsePublicKeyFromPEM ¶ added in v1.0.1043
解析公钥
func (Ecdsa) SetSignHash ¶ added in v1.0.2014
设置 hash 类型
func (Ecdsa) VerifyASN1 ¶ added in v1.0.1050
公钥验证, 官方默认 使用原始数据[data]对比签名后数据
func (Ecdsa) VerifyBytes ¶ added in v1.0.2039
公钥验证 使用原始数据[data]对比签名后数据
func (Ecdsa) WithPrivateKey ¶
func (this Ecdsa) WithPrivateKey(data *ecdsa.PrivateKey) Ecdsa
设置 PrivateKey
func (Ecdsa) WithPublicKey ¶
设置 PublicKey