Documentation ¶
Index ¶
- Variables
- type DSAErrorFunc
- type EncodingType
- type Gost
- func FromBase64String(data string) Gost
- func FromBytes(data []byte) Gost
- func FromHexString(data string) Gost
- func FromPKCS8PrivateKey(key []byte) Gost
- func FromPKCS8PrivateKeyWithPassword(key []byte, password string) Gost
- func FromPKCS8PublicKey(key []byte) Gost
- func FromPrivateKey(key []byte) Gost
- func FromPrivateKeyWithPassword(key []byte, password string) Gost
- func FromPublicKey(key []byte) Gost
- func FromString(data string) Gost
- func GenerateKey(curve string) Gost
- func GenerateKeyWithSeed(reader io.Reader) Gost
- func New() Gost
- func NewGost() Gost
- func (this Gost) AppendError(err ...error) Gost
- func (this Gost) CheckKeyPair() bool
- func (this Gost) CreatePKCS8PrivateKey() Gost
- func (this Gost) CreatePKCS8PrivateKeyWithPassword(password string, opts ...any) Gost
- func (this Gost) CreatePKCS8PublicKey() Gost
- func (this Gost) CreatePrivateKey() Gost
- func (this Gost) CreatePrivateKeyWithPassword(password string, opts ...any) Gost
- func (this Gost) CreatePublicKey() Gost
- func (this Gost) Error() error
- func (this Gost) FromBase64String(data string) Gost
- func (this Gost) FromBytes(data []byte) Gost
- func (this Gost) FromHexString(data string) Gost
- func (this Gost) FromPKCS8PrivateKey(key []byte) Gost
- func (this Gost) FromPKCS8PrivateKeyDer(der []byte) Gost
- func (this Gost) FromPKCS8PrivateKeyWithPassword(key []byte, password string) Gost
- func (this Gost) FromPKCS8PublicKey(key []byte) Gost
- func (this Gost) FromPKCS8PublicKeyDer(der []byte) Gost
- func (this Gost) FromPrivateKey(key []byte) Gost
- func (this Gost) FromPrivateKeyBytes(priBytes []byte) Gost
- func (this Gost) FromPrivateKeyWithPassword(key []byte, password string) Gost
- func (this Gost) FromPublicKey(key []byte) Gost
- func (this Gost) FromPublicKeyBytes(pubBytes []byte) Gost
- func (this Gost) FromString(data string) Gost
- func (this Gost) GenerateKey() Gost
- func (this Gost) GenerateKeyWithSeed(reader io.Reader) Gost
- func (this Gost) GetCurve() *gost.Curve
- func (this Gost) GetData() []byte
- func (this Gost) GetEncoding() EncodingType
- func (this Gost) GetErrors() []error
- func (this Gost) GetKeyData() []byte
- func (this Gost) GetParsedData() []byte
- func (this Gost) GetPrivateKey() *gost.PrivateKey
- func (this Gost) GetPrivateKeyBytes() []byte
- func (this Gost) GetPublicKey() *gost.PublicKey
- func (this Gost) GetPublicKeyBytes() []byte
- func (this Gost) GetSecretData() []byte
- func (this Gost) GetSignHash() HashFunc
- func (this Gost) GetVerify() bool
- func (this Gost) KEK(ukm any) Gost
- func (this Gost) KEK2001(ukm any) Gost
- func (this Gost) KEK2012256(ukm any) Gost
- func (this Gost) KEK2012512(ukm any) Gost
- func (this Gost) MakeKeyDer() Gost
- func (this Gost) MakePublicKey() Gost
- func (this Gost) OnError(fn DSAErrorFunc) Gost
- func (this Gost) ParsePrivateKeyFromPEM(key []byte) (*gost.PrivateKey, error)
- func (this Gost) ParsePrivateKeyFromPEMWithPassword(key []byte, password string) (*gost.PrivateKey, error)
- func (this Gost) ParsePublicKeyFromPEM(key []byte) (*gost.PublicKey, error)
- func (this Gost) SetCurve(curve string) Gost
- func (this Gost) SetSignHash(data string) Gost
- func (this Gost) Sign() Gost
- func (this Gost) SignASN1() Gost
- func (this Gost) SignBytes() Gost
- func (this Gost) ToBase64String() string
- func (this Gost) ToBytes() []byte
- func (this Gost) ToHexString() string
- func (this Gost) ToKeyBytes() []byte
- func (this Gost) ToKeyString() string
- func (this Gost) ToSecretBase64String() string
- func (this Gost) ToSecretBytes() []byte
- func (this Gost) ToSecretHexString() string
- func (this Gost) ToSecretString() string
- func (this Gost) ToString() string
- func (this Gost) ToVerify() bool
- func (this Gost) ToVerifyInt() int
- func (this Gost) Verify(data []byte) Gost
- func (this Gost) VerifyASN1(data []byte) Gost
- func (this Gost) VerifyBytes(data []byte) Gost
- func (this Gost) WithCurve(curve *gost.Curve) Gost
- func (this Gost) WithData(data []byte) Gost
- func (this Gost) WithEncoding(encoding EncodingType) Gost
- func (this Gost) WithEncodingASN1() Gost
- func (this Gost) WithEncodingBytes() Gost
- func (this Gost) WithErrors(errs []error) Gost
- func (this Gost) WithParsedData(data []byte) Gost
- func (this Gost) WithPrivateKey(data *gost.PrivateKey) Gost
- func (this Gost) WithPublicKey(data *gost.PublicKey) Gost
- func (this Gost) WithSecretData(data []byte) Gost
- func (this Gost) WithSignHash(data HashFunc) Gost
- func (this Gost) WithVerify(data bool) Gost
- 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 EncodingType ¶ added in v1.0.3009
type EncodingType uint
数据编码方式 marshal data type
const ( EncodingASN1 EncodingType = 1 + iota EncodingBytes )
type Gost ¶
type Gost struct { // 错误 Errors []error // contains filtered or unexported fields }
*
- Gost *
- @create 2024-2-25
- @author deatil
func FromPKCS8PrivateKeyWithPassword ¶
PKCS8 私钥带密码
func FromPrivateKeyWithPassword ¶
私钥带密码
func (Gost) CreatePKCS8PrivateKey ¶
生成 pkcs8 私钥 pem 数据
func (Gost) CreatePKCS8PrivateKeyWithPassword ¶
生成 PKCS8 私钥带密码 pem 数据
func (Gost) CreatePrivateKeyWithPassword ¶
生成私钥带密码 pem 数据
func (Gost) FromPKCS8PrivateKeyDer ¶
Pkcs8 DER 私钥
func (Gost) FromPKCS8PrivateKeyWithPassword ¶
PKCS8 私钥带密码
func (Gost) FromPKCS8PublicKeyDer ¶
PKCS8 DER 公钥
func (Gost) FromPrivateKeyBytes ¶
私钥明文, hex 或者 base64 解码后
func (Gost) FromPrivateKeyWithPassword ¶
私钥带密码
func (Gost) FromPublicKeyBytes ¶
公钥明文, hex 或者 base64 解码后
func (Gost) GetPrivateKeyBytes ¶ added in v1.0.2051
获取 PrivateKey 明文
func (Gost) GetPublicKeyBytes ¶ added in v1.0.2051
获取 PublicKey 明文
func (Gost) ParsePrivateKeyFromPEM ¶
func (this Gost) ParsePrivateKeyFromPEM(key []byte) (*gost.PrivateKey, error)
解析私钥
func (Gost) ParsePrivateKeyFromPEMWithPassword ¶
func (this Gost) ParsePrivateKeyFromPEMWithPassword(key []byte, password string) (*gost.PrivateKey, error)
解析带密码的私钥
func (Gost) ParsePublicKeyFromPEM ¶
解析公钥
func (Gost) SetCurve ¶
设置曲线类型 可选参数: IdGostR34102001TestParamSet IdGostR34102001CryptoProAParamSet IdGostR34102001CryptoProBParamSet IdGostR34102001CryptoProCParamSet IdGostR34102001CryptoProXchAParamSet IdGostR34102001CryptoProXchBParamSet Idtc26gost34102012256paramSetA Idtc26gost34102012256paramSetB Idtc26gost34102012256paramSetC Idtc26gost34102012256paramSetD Idtc26gost34102012512paramSetTest Idtc26gost34102012512paramSetA Idtc26gost34102012512paramSetB Idtc26gost34102012512paramSetC
func (Gost) SetSignHash ¶
设置 hash 类型 可用参数可查看 Hash 结构体数据
func (Gost) VerifyASN1 ¶
公钥验证 使用原始数据[data]对比签名后数据 publicKey Verify with asn.1
func (Gost) VerifyBytes ¶ added in v1.0.2069
公钥验证 使用原始数据[data]对比签名后数据 publicKey Verify with bytes
func (Gost) WithEncoding ¶ added in v1.0.3009
func (this Gost) WithEncoding(encoding EncodingType) Gost
设置编码方式
func (Gost) WithEncodingASN1 ¶ added in v1.0.3009
设置 ASN1 编码方式
func (Gost) WithEncodingBytes ¶ added in v1.0.3009
设置明文编码方式
func (Gost) WithPrivateKey ¶
func (this Gost) WithPrivateKey(data *gost.PrivateKey) Gost
设置 PrivateKey