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(hash 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) FromPrivateKeyDBytes(DBytes []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) FromPublicKeyDer(der []byte) Ecdsa
- func (this Ecdsa) FromPublicKeyString(keyString 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) 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) GetPrivateKeyXHexString() string
- func (this Ecdsa) GetPrivateKeyYHexString() string
- func (this Ecdsa) GetPublicKey() *ecdsa.PublicKey
- func (this Ecdsa) GetPublicKeyCurve() elliptic.Curve
- func (this Ecdsa) GetPublicKeyXHexString() string
- func (this Ecdsa) GetPublicKeyYHexString() string
- func (this Ecdsa) GetSignHash() HashFunc
- func (this Ecdsa) GetVerify() bool
- 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) SignAsn1() Ecdsa
- func (this Ecdsa) SignHex() 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) VerifyAsn1(data []byte) Ecdsa
- func (this Ecdsa) VerifyHex(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 (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 ¶
明文私钥生成私钥结构体
func (Ecdsa) FromPrivateKeyDBytes ¶
私钥字符,必须先添加公钥
func (Ecdsa) FromPrivateKeyString ¶
私钥字符,必须先添加公钥 (hexStringD)
func (Ecdsa) FromPrivateKeyWithPassword ¶
私钥带密码
func (Ecdsa) FromPublicKeyDer ¶ added in v1.0.2015
DER 公钥
func (Ecdsa) FromPublicKeyString ¶
公钥字符 (hexStringX + hexStringY)
func (Ecdsa) FromPublicKeyXYBytes ¶
公钥字符对
func (Ecdsa) FromPublicKeyXYString ¶ added in v1.0.1018
公钥 x,y 16进制字符对 [xString: xHexString, yString: yHexString]
func (Ecdsa) GetPrivateKeyCurve ¶
获取 PrivateKeyCurve
func (Ecdsa) GetPrivateKeyDHexString ¶ added in v1.0.1018
获取 PrivateKeyD
func (Ecdsa) GetPrivateKeyXHexString ¶ added in v1.0.1018
获取 PrivateKeyX
func (Ecdsa) GetPrivateKeyYHexString ¶ added in v1.0.1018
获取 PrivateKeyY
func (Ecdsa) GetPublicKeyCurve ¶
获取 PublicKeyCurve
func (Ecdsa) GetPublicKeyXHexString ¶ added in v1.0.1018
获取 PublicKeyX
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) WithPrivateKey ¶
func (this Ecdsa) WithPrivateKey(data *ecdsa.PrivateKey) Ecdsa
设置 PrivateKey
func (Ecdsa) WithPublicKey ¶
设置 PublicKey