Documentation
¶
Index ¶
- Variables
- type DSA
- func FromBase64String(data string) DSA
- func FromBytes(data []byte) DSA
- func FromHexString(data string) DSA
- func FromPKCS1PrivateKey(key []byte) DSA
- func FromPKCS1PrivateKeyWithPassword(key []byte, password string) DSA
- func FromPKCS1PublicKey(key []byte) DSA
- func FromPKCS8PrivateKey(key []byte) DSA
- func FromPKCS8PrivateKeyWithPassword(key []byte, password string) DSA
- func FromPKCS8PublicKey(key []byte) DSA
- func FromPrivateKey(key []byte) DSA
- func FromPrivateKeyWithPassword(key []byte, password string) DSA
- func FromPublicKey(key []byte) DSA
- func FromString(data string) DSA
- func FromXMLPrivateKey(key []byte) DSA
- func FromXMLPublicKey(key []byte) DSA
- func GenerateKey(ln string) DSA
- func GenerateKeyWithSeed(paramReader, generateReader io.Reader, ln string) DSA
- func New() DSA
- func NewDSA() DSA
- func (this DSA) AppendError(err ...error) DSA
- func (this DSA) CheckKeyPair() bool
- func (this DSA) CreatePKCS1PrivateKey() DSA
- func (this DSA) CreatePKCS1PrivateKeyWithPassword(password string, opts ...string) DSA
- func (this DSA) CreatePKCS1PublicKey() DSA
- func (this DSA) CreatePKCS8PrivateKey() DSA
- func (this DSA) CreatePKCS8PrivateKeyWithPassword(password string, opts ...any) DSA
- func (this DSA) CreatePKCS8PublicKey() DSA
- func (this DSA) CreatePrivateKey() DSA
- func (this DSA) CreatePrivateKeyWithPassword(password string, opts ...string) DSA
- func (this DSA) CreatePublicKey() DSA
- func (this DSA) CreateXMLPrivateKey() DSA
- func (this DSA) CreateXMLPublicKey() DSA
- func (this DSA) Error() error
- func (this DSA) FromBase64String(data string) DSA
- func (this DSA) FromBytes(data []byte) DSA
- func (this DSA) FromHexString(data string) DSA
- func (this DSA) FromPKCS1PrivateKey(key []byte) DSA
- func (this DSA) FromPKCS1PrivateKeyDer(der []byte) DSA
- func (this DSA) FromPKCS1PrivateKeyWithPassword(key []byte, password string) DSA
- func (this DSA) FromPKCS1PublicKey(key []byte) DSA
- func (this DSA) FromPKCS1PublicKeyDer(der []byte) DSA
- func (this DSA) FromPKCS8PrivateKey(key []byte) DSA
- func (this DSA) FromPKCS8PrivateKeyDer(der []byte) DSA
- func (this DSA) FromPKCS8PrivateKeyWithPassword(key []byte, password string) DSA
- func (this DSA) FromPKCS8PublicKey(key []byte) DSA
- func (this DSA) FromPKCS8PublicKeyDer(der []byte) DSA
- func (this DSA) FromPrivateKey(key []byte) DSA
- func (this DSA) FromPrivateKeyWithPassword(key []byte, password string) DSA
- func (this DSA) FromPublicKey(key []byte) DSA
- func (this DSA) FromString(data string) DSA
- func (this DSA) FromXMLPrivateKey(key []byte) DSA
- func (this DSA) FromXMLPublicKey(key []byte) DSA
- func (this DSA) GenerateKey(ln string) DSA
- func (this DSA) GenerateKeyWithSeed(paramReader, generateReader io.Reader, ln string) DSA
- func (this DSA) GetData() []byte
- func (this DSA) GetEncoding() EncodingType
- func (this DSA) GetErrors() []error
- func (this DSA) GetKeyData() []byte
- func (this DSA) GetParsedData() []byte
- func (this DSA) GetPrivateKey() *dsa.PrivateKey
- func (this DSA) GetPublicKey() *dsa.PublicKey
- func (this DSA) GetSignHash() HashFunc
- func (this DSA) GetVerify() bool
- func (this DSA) MakeKeyDer() DSA
- func (this DSA) MakePublicKey() DSA
- func (this DSA) OnError(fn func([]error)) DSA
- func (this DSA) ParsePKCS1PrivateKeyFromPEM(key []byte) (*dsa.PrivateKey, error)
- func (this DSA) ParsePKCS1PrivateKeyFromPEMWithPassword(key []byte, password string) (*dsa.PrivateKey, error)
- func (this DSA) ParsePKCS1PublicKeyFromPEM(key []byte) (*dsa.PublicKey, error)
- func (this DSA) ParsePKCS8PrivateKeyFromPEM(key []byte) (*dsa.PrivateKey, error)
- func (this DSA) ParsePKCS8PrivateKeyFromPEMWithPassword(key []byte, password string) (*dsa.PrivateKey, error)
- func (this DSA) ParsePKCS8PublicKeyFromPEM(key []byte) (*dsa.PublicKey, error)
- func (this DSA) ParsePrivateKeyFromXML(key []byte) (*dsa.PrivateKey, error)
- func (this DSA) ParsePublicKeyFromXML(key []byte) (*dsa.PublicKey, error)
- func (this DSA) SetSignHash(data string) DSA
- func (this DSA) Sign() DSA
- func (this DSA) SignASN1() DSA
- func (this DSA) SignBytes() DSA
- func (this DSA) SignWithSeparator(separator ...string) DSA
- func (this DSA) ToBase64String() string
- func (this DSA) ToBytes() []byte
- func (this DSA) ToHexString() string
- func (this DSA) ToKeyBytes() []byte
- func (this DSA) ToKeyString() string
- func (this DSA) ToString() string
- func (this DSA) ToVerify() bool
- func (this DSA) ToVerifyInt() int
- func (this DSA) Verify(data []byte) DSA
- func (this DSA) VerifyASN1(data []byte) DSA
- func (this DSA) VerifyBytes(data []byte) DSA
- func (this DSA) VerifyWithSeparator(data []byte, separator ...string) DSA
- func (this DSA) WithData(data []byte) DSA
- func (this DSA) WithEncoding(encoding EncodingType) DSA
- func (this DSA) WithEncodingASN1() DSA
- func (this DSA) WithEncodingBytes() DSA
- func (this DSA) WithErrors(errs []error) DSA
- func (this DSA) WithParsedData(data []byte) DSA
- func (this DSA) WithPrivateKey(data *dsa.PrivateKey) DSA
- func (this DSA) WithPublicKey(data *dsa.PublicKey) DSA
- func (this DSA) WithSignHash(data HashFunc) DSA
- func (this DSA) WithVerify(data bool) DSA
- type EncodingType
- type HashFunc
- type Opts
- type PBKDF2Opts
- type ScryptOpts
Constants ¶
This section is empty.
Variables ¶
var ( // Get cipher from name GetCipherFromName = pkcs8.GetCipherFromName // Get hash from name GetHashFromName = pkcs8.GetHashFromName )
var ( ErrKeyMustBePEMEncoded = errors.New("go-cryptobin/dsa: invalid key: Key must be a PEM encoded PKCS1 or PKCS8 key") ErrNotDSAPrivateKey = errors.New("go-cryptobin/dsa: key is not a valid DSA private key") ErrNotDSAPublicKey = errors.New("go-cryptobin/dsa: key is not a valid DSA public key") )
Functions ¶
This section is empty.
Types ¶
type DSA ¶
type DSA struct {
// error list
Errors []error
// contains filtered or unexported fields
}
*
- DSA *
- @create 2022-7-25
- @author deatil
func FromBase64String ¶ added in v1.0.1018
From Base64 String
func FromPKCS1PrivateKey ¶ added in v1.0.2015
From PKCS1 PrivateKey bytes
func FromPKCS1PrivateKeyWithPassword ¶ added in v1.0.2015
From PKCS1 PrivateKey bytes With Password
func FromPKCS1PublicKey ¶ added in v1.0.2015
From PKCS1 PublicKey bytes
func FromPKCS8PrivateKey ¶ added in v1.0.1018
From PKCS8 PrivateKey bytes
func FromPKCS8PrivateKeyWithPassword ¶ added in v1.0.1018
From PKCS8 PrivateKey bytes With Password
func FromPKCS8PublicKey ¶ added in v1.0.1018
From PKCS8 PublicKey bytes
func FromPrivateKeyWithPassword ¶ added in v1.0.1018
From PrivateKey bytes With Password
func FromXMLPrivateKey ¶ added in v1.0.2015
From PrivateKey XML bytes
func FromXMLPublicKey ¶ added in v1.0.2015
From PublicKey XML bytes
func GenerateKey ¶ added in v1.0.1018
GenerateKey params [L1024N160 | L2048N224 | L2048N256 | L3072N256]
func GenerateKeyWithSeed ¶ added in v1.0.2026
GenerateKey With Seed params [L1024N160 | L2048N224 | L2048N256 | L3072N256]
func (DSA) AppendError ¶ added in v1.0.1026
append error
func (DSA) CreatePKCS1PrivateKey ¶ added in v1.0.2014
Create PKCS1 PrivateKey PEM data
func (DSA) CreatePKCS1PrivateKeyWithPassword ¶ added in v1.0.2014
Create PKCS1 PrivateKey PEM data with password CreatePKCS1PrivateKeyWithPassword("123", "AES256CBC") PEMCipher: DESCBC | DESEDE3CBC | AES128CBC | AES192CBC | AES256CBC
func (DSA) CreatePKCS1PublicKey ¶ added in v1.0.2014
Create PKCS1 PublicKey PEM data
func (DSA) CreatePKCS8PrivateKey ¶
Create PKCS8 PrivateKey PEM data
func (DSA) CreatePKCS8PrivateKeyWithPassword ¶
Create PKCS8 PrivateKey PEM data with password CreatePKCS8PrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (DSA) CreatePKCS8PublicKey ¶
Create PKCS8 PublicKey PEM data
func (DSA) CreatePrivateKey ¶
Create PrivateKey PEM data dsa := New().GenerateKey("L2048N256") priKey := dsa.CreatePrivateKey().ToKeyString()
func (DSA) CreatePrivateKeyWithPassword ¶
Create PrivateKey PEM data with password CreatePrivateKeyWithPassword("123", "AES256CBC") PEMCipher: DESCBC | DESEDE3CBC | AES128CBC | AES192CBC | AES256CBC
func (DSA) CreateXMLPrivateKey ¶ added in v1.0.2015
Create PrivateKey XML data
func (DSA) CreateXMLPublicKey ¶ added in v1.0.2015
Create PublicKey XML data
func (DSA) FromPKCS1PrivateKey ¶ added in v1.0.2014
From PKCS1 PrivateKey bytes
func (DSA) FromPKCS1PrivateKeyDer ¶ added in v1.0.2015
From PKCS1 PrivateKey Der bytes
func (DSA) FromPKCS1PrivateKeyWithPassword ¶ added in v1.0.2014
From PKCS1 PrivateKey bytes With Password
func (DSA) FromPKCS1PublicKey ¶ added in v1.0.2014
From PKCS1 PublicKey bytes
func (DSA) FromPKCS1PublicKeyDer ¶ added in v1.0.2015
From PKCS1 PublicKey Der bytes
func (DSA) FromPKCS8PrivateKey ¶
From PKCS8 PrivateKey bytes
func (DSA) FromPKCS8PrivateKeyDer ¶ added in v1.0.2015
From PKCS8 PrivateKey Der bytes
func (DSA) FromPKCS8PrivateKeyWithPassword ¶
From PKCS8 PrivateKey bytes With Password
func (DSA) FromPKCS8PublicKey ¶
From PKCS8 PublicKey bytes
func (DSA) FromPKCS8PublicKeyDer ¶ added in v1.0.2015
From PKCS8 PublicKey Der bytes
func (DSA) FromPrivateKeyWithPassword ¶
From PrivateKey bytes With Password
func (DSA) FromXMLPrivateKey ¶ added in v1.0.2015
From PrivateKey XML bytes
func (DSA) FromXMLPublicKey ¶ added in v1.0.2015
From PublicKey XML bytes
func (DSA) GenerateKey ¶
GenerateKey params [L1024N160 | L2048N224 | L2048N256 | L3072N256]
func (DSA) GenerateKeyWithSeed ¶ added in v1.0.2026
GenerateKey With Seed params [L1024N160 | L2048N224 | L2048N256 | L3072N256]
func (DSA) GetEncoding ¶ added in v1.0.3009
func (this DSA) GetEncoding() EncodingType
get Encoding type
func (DSA) GetParsedData ¶ added in v1.0.2049
get parsed data
func (DSA) ParsePKCS1PrivateKeyFromPEM ¶ added in v1.0.2014
func (this DSA) ParsePKCS1PrivateKeyFromPEM(key []byte) (*dsa.PrivateKey, error)
Parse PKCS1 PrivateKey From PEM
func (DSA) ParsePKCS1PrivateKeyFromPEMWithPassword ¶ added in v1.0.2014
func (this DSA) ParsePKCS1PrivateKeyFromPEMWithPassword(key []byte, password string) (*dsa.PrivateKey, error)
Parse PKCS1 PrivateKey From PEM With Password
func (DSA) ParsePKCS1PublicKeyFromPEM ¶ added in v1.0.2014
Parse PKCS1 PublicKey From PEM
func (DSA) ParsePKCS8PrivateKeyFromPEM ¶
func (this DSA) ParsePKCS8PrivateKeyFromPEM(key []byte) (*dsa.PrivateKey, error)
Parse PKCS8 PrivateKey From PEM
func (DSA) ParsePKCS8PrivateKeyFromPEMWithPassword ¶
func (this DSA) ParsePKCS8PrivateKeyFromPEMWithPassword(key []byte, password string) (*dsa.PrivateKey, error)
Parse PKCS8 PrivateKey From PEM With Password
func (DSA) ParsePKCS8PublicKeyFromPEM ¶
Parse PKCS8 PublicKey From PEM
func (DSA) ParsePrivateKeyFromXML ¶ added in v1.0.2015
func (this DSA) ParsePrivateKeyFromXML(key []byte) (*dsa.PrivateKey, error)
Parse PrivateKey From XML
func (DSA) ParsePublicKeyFromXML ¶ added in v1.0.2015
Parse PublicKey From XML
func (DSA) SetSignHash ¶ added in v1.0.2014
Set hash type 可用参数可查看 Hash 结构体数据
func (DSA) SignWithSeparator ¶ added in v1.0.2050
privateKey Sign With Separator
func (DSA) ToVerifyInt ¶ added in v1.0.1033
output verify int data
func (DSA) VerifyASN1 ¶ added in v1.0.2039
publicKey Verify ASN1 使用原始数据[data]对比签名后数据
func (DSA) VerifyBytes ¶
publicKey Verify Bytes 使用原始数据[data]对比签名后数据
func (DSA) VerifyWithSeparator ¶ added in v1.0.2050
publicKey Verify With Separator 使用原始数据[data]对比签名后数据
func (DSA) WithEncoding ¶ added in v1.0.3009
func (this DSA) WithEncoding(encoding EncodingType) DSA
Set encoding type
func (DSA) WithEncodingASN1 ¶ added in v1.0.3009
Set ASN1 Encoding
func (DSA) WithEncodingBytes ¶ added in v1.0.3009
Set Plain Encoding
func (DSA) WithErrors ¶ added in v1.0.1026
Set error list
func (DSA) WithParsedData ¶ added in v1.0.2049
Set parsedData
type EncodingType ¶ added in v1.0.3009
type EncodingType uint
数据编码方式 marshal data type
const ( EncodingASN1 EncodingType = 1 + iota EncodingBytes )