Documentation ¶
Index ¶
- Constants
- func GenerateRandom(length int) ([]byte, error)
- func GetCipherBlockLength(name string) (int, error)
- func GetCipherIVLength(name string) (int, error)
- func GetCipherKeyLength(name string) (int, error)
- func GetCipherNames() []string
- func GetDeriveKeyAlgorithmNames(pkey string) ([]string, error)
- func GetDigestBlockSize(name string) (int, error)
- func GetDigestLength(name string) (int, error)
- func GetDigestNames() []string
- func GetEngineNames() []string
- func GetErrors() error
- func GetMacLength(name string) (int, error)
- func GetPublicKeyAlgorithmNames() []string
- func GetPublicKeyEncryptionNames(pkey string) ([]string, error)
- func GetSignAlgorithmNames(pkey string) ([]string, error)
- func GetVersions() []string
- func SeedRandom(seed []byte) error
- type Certificate
- func (cert *Certificate) CheckPrivateKey(skey *PrivateKey) error
- func (cert *Certificate) GetIssuer() (string, error)
- func (cert *Certificate) GetPublicKey() (*PublicKey, error)
- func (cert *Certificate) GetSerialNumber() (string, error)
- func (cert *Certificate) GetSubject() (string, error)
- func (cert *Certificate) GetText() (string, error)
- type CipherContext
- type DigestContext
- type Engine
- func (e *Engine) GetCommands() ([]string, error)
- func (e *Engine) GetPrivateKey(id string, pass string) (*PrivateKey, error)
- func (e *Engine) GetPublicKey(id string, pass string) (*PublicKey, error)
- func (e *Engine) LoadConfigFile(path string) error
- func (e *Engine) RunCommand(name, arg string) error
- type HMACContext
- type PkeyCtxParams
- type PrivateKey
- func (sk *PrivateKey) ComputeSM2IDDigest(id string) ([]byte, error)
- func (sk *PrivateKey) Decrypt(alg string, in []byte, eng *Engine) ([]byte, error)
- func (sk *PrivateKey) DeriveKey(alg string, peer PublicKey, eng *Engine) ([]byte, error)
- func (sk *PrivateKey) GetPEM(cipher string, pass string) (string, error)
- func (sk *PrivateKey) GetPublicKeyPEM() (string, error)
- func (sk *PrivateKey) GetText() (string, error)
- func (sk *PrivateKey) GetUnencryptedPEM() (string, error)
- func (sk *PrivateKey) Sign(alg string, dgst []byte, eng *Engine) ([]byte, error)
- type PublicKey
- func (pk *PublicKey) ComputeSM2IDDigest(id string) ([]byte, error)
- func (pk *PublicKey) Encrypt(alg string, in []byte, eng *Engine) ([]byte, error)
- func (pk *PublicKey) GetPEM() (string, error)
- func (pk *PublicKey) GetText() (string, error)
- func (pk *PublicKey) Verify(alg string, dgst, sig []byte, eng *Engine) error
- type SSLConnection
- type SSLContext
Constants ¶
View Source
const ( EC = "EC" RSA = "RSA" DSA = "DSA" DH = "DH" )
Variables ¶
This section is empty.
Functions ¶
func GenerateRandom ¶
func GetCipherBlockLength ¶
func GetCipherIVLength ¶
func GetCipherKeyLength ¶
func GetCipherNames ¶
func GetCipherNames() []string
func GetDigestBlockSize ¶
func GetDigestLength ¶
func GetDigestNames ¶
func GetDigestNames() []string
func GetEngineNames ¶
func GetEngineNames() []string
func GetMacLength ¶
func GetPublicKeyAlgorithmNames ¶
func GetPublicKeyAlgorithmNames() []string
func GetSignAlgorithmNames ¶
func GetVersions ¶
func GetVersions() []string
func SeedRandom ¶
Types ¶
type Certificate ¶
type Certificate struct {
// contains filtered or unexported fields
}
func NewCertificateFromPEM ¶
func NewCertificateFromPEM(pem string, pass string) (*Certificate, error)
func (*Certificate) CheckPrivateKey ¶
func (cert *Certificate) CheckPrivateKey(skey *PrivateKey) error
func (*Certificate) GetIssuer ¶
func (cert *Certificate) GetIssuer() (string, error)
func (*Certificate) GetPublicKey ¶
func (cert *Certificate) GetPublicKey() (*PublicKey, error)
func (*Certificate) GetSerialNumber ¶
func (cert *Certificate) GetSerialNumber() (string, error)
func (*Certificate) GetSubject ¶
func (cert *Certificate) GetSubject() (string, error)
func (*Certificate) GetText ¶
func (cert *Certificate) GetText() (string, error)
type CipherContext ¶
type CipherContext struct {
// contains filtered or unexported fields
}
func NewCipherContext ¶
func NewCipherContext(name string, key, iv []byte, encrypt bool) ( *CipherContext, error)
func (*CipherContext) Final ¶
func (ctx *CipherContext) Final() ([]byte, error)
type DigestContext ¶
type DigestContext struct {
// contains filtered or unexported fields
}
func NewDigestContext ¶
func NewDigestContext(name string) (*DigestContext, error)
func (*DigestContext) Final ¶
func (ctx *DigestContext) Final() ([]byte, error)
func (*DigestContext) Reset ¶
func (ctx *DigestContext) Reset() error
func (*DigestContext) Update ¶
func (ctx *DigestContext) Update(data []byte) error
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func NewEngineByName ¶
func (*Engine) GetCommands ¶
func (*Engine) GetPrivateKey ¶
func (e *Engine) GetPrivateKey(id string, pass string) (*PrivateKey, error)
func (*Engine) GetPublicKey ¶
func (*Engine) LoadConfigFile ¶
func (*Engine) RunCommand ¶
type HMACContext ¶
type HMACContext struct {
// contains filtered or unexported fields
}
func NewHMACContext ¶
func NewHMACContext(name string, key []byte) ( *HMACContext, error)
func (*HMACContext) Final ¶
func (ctx *HMACContext) Final() ([]byte, error)
func (*HMACContext) Reset ¶
func (ctx *HMACContext) Reset() error
func (*HMACContext) Update ¶
func (ctx *HMACContext) Update(data []byte) error
type PkeyCtxParams ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func GeneratePrivateKey ¶
func GeneratePrivateKey(alg string, params *PkeyCtxParams, eng *Engine) (*PrivateKey, error)
func NewPrivateKeyFromPEM ¶
func NewPrivateKeyFromPEM(pem string, pass string) (*PrivateKey, error)
func (*PrivateKey) ComputeSM2IDDigest ¶
func (sk *PrivateKey) ComputeSM2IDDigest(id string) ([]byte, error)
func (*PrivateKey) GetPEM ¶
func (sk *PrivateKey) GetPEM(cipher string, pass string) (string, error)
func (*PrivateKey) GetPublicKeyPEM ¶
func (sk *PrivateKey) GetPublicKeyPEM() (string, error)
func (*PrivateKey) GetText ¶
func (sk *PrivateKey) GetText() (string, error)
func (*PrivateKey) GetUnencryptedPEM ¶
func (sk *PrivateKey) GetUnencryptedPEM() (string, error)
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func NewPublicKeyFromPEM ¶
func (*PublicKey) ComputeSM2IDDigest ¶
type SSLConnection ¶
type SSLConnection struct {
// contains filtered or unexported fields
}
func (*SSLConnection) GetPeerCertificate ¶
func (conn *SSLConnection) GetPeerCertificate() (*Certificate, error)
func (*SSLConnection) GetVerifyResult ¶
func (conn *SSLConnection) GetVerifyResult() (int64, error)
type SSLContext ¶
type SSLContext struct {
// contains filtered or unexported fields
}
func NewSSLContext ¶
func NewSSLContext(protocol_version, ca_certs, client_certs string) (*SSLContext, error)
func (*SSLContext) Connect ¶
func (ctx *SSLContext) Connect(hostname, port, ciphers string) (*SSLConnection, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.