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) 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) GetCurve() elliptic.Curve
- func (this ECDSA) GetData() []byte
- func (this ECDSA) GetErrors() []error
- func (this ECDSA) GetKeyData() []byte
- func (this ECDSA) GetParsedData() []byte
- func (this ECDSA) GetPrivateKey() *ecdsa.PrivateKey
- func (this ECDSA) GetPrivateKeyCurve() elliptic.Curve
- func (this ECDSA) GetPrivateKeyDString() 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) GetPublicKeyXString() string
- func (this ECDSA) GetPublicKeyXYString() string
- func (this ECDSA) GetPublicKeyYString() 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() 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) 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) WithParsedData(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 = pkcs8.GetCipherFromName // 获取 hash 类型 GetHashFromName = pkcs8.GetHashFromName )
Functions ¶
This section is empty.
Types ¶
type ECDSA ¶ added in v1.0.2048
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.2048
添加错误
func (ECDSA) CreatePKCS1PrivateKey ¶ added in v1.0.2048
生成私钥 pem 数据
func (ECDSA) CreatePKCS1PrivateKeyWithPassword ¶ added in v1.0.2048
生成私钥带密码 pem 数据
func (ECDSA) CreatePKCS8PrivateKey ¶ added in v1.0.2048
生成 PKCS8 私钥 pem 数据
func (ECDSA) CreatePKCS8PrivateKeyWithPassword ¶ added in v1.0.2048
生成 PKCS8 私钥带密码 pem 数据 CreatePKCS8PrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (ECDSA) CreatePrivateKey ¶ added in v1.0.2048
生成私钥 pem 数据, PKCS1 别名 使用: obj := New().WithCurve("P521").GenerateKey() priKey := obj.CreatePrivateKey().ToKeyString()
func (ECDSA) CreatePrivateKeyWithPassword ¶ added in v1.0.2048
生成私钥带密码 pem 数据, PKCS1 别名 CreatePrivateKeyWithPassword("123", "AES256CBC") PEMCipher: DESCBC | DESEDE3CBC | AES128CBC | AES192CBC | AES256CBC
func (ECDSA) CreatePublicKey ¶ added in v1.0.2048
生成公钥 pem 数据
func (ECDSA) FromBase64String ¶ added in v1.0.2048
Base64
func (ECDSA) FromHexString ¶ added in v1.0.2048
Hex
func (ECDSA) FromPKCS1PrivateKey ¶ added in v1.0.2048
私钥
func (ECDSA) FromPKCS1PrivateKeyDer ¶ added in v1.0.2048
DER 私钥
func (ECDSA) FromPKCS1PrivateKeyWithPassword ¶ added in v1.0.2048
私钥带密码
func (ECDSA) FromPKCS8PrivateKey ¶ added in v1.0.2048
PKCS8 私钥
func (ECDSA) FromPKCS8PrivateKeyDer ¶ added in v1.0.2048
DER 私钥
func (ECDSA) FromPKCS8PrivateKeyWithPassword ¶ added in v1.0.2048
Pkcs8WithPassword
func (ECDSA) FromPrivateKey ¶ added in v1.0.2048
私钥
func (ECDSA) FromPrivateKeyBytes ¶ added in v1.0.2048
明文私钥生成私钥结构体 需要设置对应的 curve
func (ECDSA) FromPrivateKeyString ¶ added in v1.0.2048
私钥明文,需要设置对应的 curve private-key: 07e4********;
func (ECDSA) FromPrivateKeyWithPassword ¶ added in v1.0.2048
私钥带密码
func (ECDSA) FromPublicKey ¶ added in v1.0.2048
公钥
func (ECDSA) FromPublicKeyBytes ¶ added in v1.0.2048
公钥明文, hex 或者 base64 解码后 需要设置对应的 curve
func (ECDSA) FromPublicKeyCompressString ¶ added in v1.0.2048
公钥明文压缩 需要设置对应的 curve public-key hex: 027c******** || 036c********
func (ECDSA) FromPublicKeyDer ¶ added in v1.0.2048
DER 公钥
func (ECDSA) FromPublicKeyString ¶ added in v1.0.2048
公钥明文,需要设置对应的 curve
func (ECDSA) FromPublicKeyUncompressString ¶ added in v1.0.2048
公钥明文未压缩 需要设置对应的 curve public-key hex: 047c********.
func (ECDSA) FromPublicKeyXYBytes ¶ added in v1.0.2048
公钥字符对,需要设置对应的 curve
func (ECDSA) FromPublicKeyXYString ¶ added in v1.0.2048
公钥 x,y 16进制字符对 需要设置对应的 curve [xString: xHexString, yString: yHexString]
func (ECDSA) GenerateKeyWithSeed ¶ added in v1.0.2048
生成密钥
func (ECDSA) GetParsedData ¶ added in v1.0.2049
get parsedData
func (ECDSA) GetPrivateKey ¶ added in v1.0.2048
func (this ECDSA) GetPrivateKey() *ecdsa.PrivateKey
get PrivateKey
func (ECDSA) GetPrivateKeyCurve ¶ added in v1.0.2048
get PrivateKey Curve
func (ECDSA) GetPrivateKeyDString ¶ added in v1.0.2071
get PrivateKey D hex string
func (ECDSA) GetPrivateKeyString ¶ added in v1.0.2048
get PrivateKey data hex string
func (ECDSA) GetPublicKey ¶ added in v1.0.2048
get PublicKey
func (ECDSA) GetPublicKeyCompressString ¶ added in v1.0.2048
get PublicKey Compress Hex string
func (ECDSA) GetPublicKeyCurve ¶ added in v1.0.2048
get PublicKey Curve
func (ECDSA) GetPublicKeyUncompressString ¶ added in v1.0.2048
get PublicKey Uncompress Hex string
func (ECDSA) GetPublicKeyXString ¶ added in v1.0.2071
get PublicKey X hex string
func (ECDSA) GetPublicKeyXYString ¶ added in v1.0.2071
get PublicKey X and Y Hex string
func (ECDSA) GetPublicKeyYString ¶ added in v1.0.2071
get PublicKey Y hex string
func (ECDSA) GetSignHash ¶ added in v1.0.2048
get signHash type
func (ECDSA) ParsePKCS1PrivateKeyFromPEM ¶ added in v1.0.2048
func (this ECDSA) ParsePKCS1PrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error)
解析私钥
func (ECDSA) ParsePKCS1PrivateKeyFromPEMWithPassword ¶ added in v1.0.2048
func (this ECDSA) ParsePKCS1PrivateKeyFromPEMWithPassword(key []byte, password string) (*ecdsa.PrivateKey, error)
解析私钥带密码
func (ECDSA) ParsePKCS8PrivateKeyFromPEM ¶ added in v1.0.2048
func (this ECDSA) ParsePKCS8PrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error)
解析私钥
func (ECDSA) ParsePKCS8PrivateKeyFromPEMWithPassword ¶ added in v1.0.2048
func (this ECDSA) ParsePKCS8PrivateKeyFromPEMWithPassword(key []byte, password string) (*ecdsa.PrivateKey, error)
解析 PKCS8 带密码的私钥
func (ECDSA) ParsePublicKeyFromPEM ¶ added in v1.0.2048
解析公钥
func (ECDSA) SetSignHash ¶ added in v1.0.2048
设置 hash 类型
func (ECDSA) VerifyASN1 ¶ added in v1.0.2048
公钥验证 ASN1 使用原始数据[data]对比签名后数据
func (ECDSA) VerifyBytes ¶ added in v1.0.2048
公钥验证 Bytes 使用原始数据[data]对比签名后数据
func (ECDSA) WithParsedData ¶ added in v1.0.2049
设置 parsedData
func (ECDSA) WithPrivateKey ¶ added in v1.0.2048
func (this ECDSA) WithPrivateKey(data *ecdsa.PrivateKey) ECDSA
设置 PrivateKey
func (ECDSA) WithPublicKey ¶ added in v1.0.2048
设置 PublicKey
func (ECDSA) WithSignHash ¶ added in v1.0.2048
设置 hash 类型