Documentation ¶
Index ¶
- Variables
- func AddCipher(oid asn1.ObjectIdentifier, cipher func() PEMCipher)
- func CheckCipherFromName(name string) bool
- func DecryptPEMBlock(block *pem.Block, password []byte) ([]byte, error)
- func DecryptPKCS8PrivateKey(data, password []byte) ([]byte, error)
- func EncryptPKCS8PrivateKey(rand io.Reader, blockType string, data []byte, password []byte, ...) (*pem.Block, error)
- type CipherBlockCBC
- func (this CipherBlockCBC) Decrypt(password, params, ciphertext []byte) ([]byte, error)
- func (this CipherBlockCBC) Encrypt(password, plaintext []byte) ([]byte, []byte, error)
- func (this CipherBlockCBC) KeySize() int
- func (this CipherBlockCBC) OID() asn1.ObjectIdentifier
- func (this CipherBlockCBC) WithSaltSize(saltSize int) CipherBlockCBC
- type CipherRC4
- func (this CipherRC4) Decrypt(password, params, ciphertext []byte) ([]byte, error)
- func (this CipherRC4) Encrypt(password, plaintext []byte) ([]byte, []byte, error)
- func (this CipherRC4) KeySize() int
- func (this CipherRC4) OID() asn1.ObjectIdentifier
- func (this CipherRC4) WithSaltSize(saltSize int) CipherRC4
- type PEMCipher
Constants ¶
This section is empty.
Variables ¶
View Source
var PEMCipherMD2AndDES = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var PEMCipherMD2AndRC2_64 = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var PEMCipherMD5AndDES = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var PEMCipherMD5AndRC2_64 = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var PEMCipherMap = map[string]PEMCipher{ "MD2AndDES": PEMCipherMD2AndDES, "MD5AndDES": PEMCipherMD5AndDES, "SHA1AndDES": PEMCipherSHA1AndDES, "SHA1And3DES": PEMCipherSHA1And3DES, "SHA1AndRC4_128": PEMCipherSHA1AndRC4_128, "SHA1AndRC4_40": PEMCipherSHA1AndRC4_40, "SHA1AndRC2_128": PEMCipherSHA1AndRC2_128, "SHA1AndRC2_40": PEMCipherSHA1AndRC2_40, "SHA1AndRC2_64": PEMCipherSHA1AndRC2_64, "MD2AndRC2_64": PEMCipherMD2AndRC2_64, "MD5AndRC2_64": PEMCipherMD5AndRC2_64, }
PEMCipher 列表
View Source
var PEMCipherSHA1And3DES = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var PEMCipherSHA1AndDES = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var PEMCipherSHA1AndRC2_128 = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var PEMCipherSHA1AndRC2_40 = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var PEMCipherSHA1AndRC2_64 = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var PEMCipherSHA1AndRC4_128 = CipherRC4{ // contains filtered or unexported fields }
View Source
var PEMCipherSHA1AndRC4_40 = CipherRC4{ // contains filtered or unexported fields }
Functions ¶
func DecryptPEMBlock ¶
解出 PEM 块
func DecryptPKCS8PrivateKey ¶
解出 PKCS8 密钥
Types ¶
type CipherBlockCBC ¶
type CipherBlockCBC struct {
// contains filtered or unexported fields
}
cbc 模式加密
func (CipherBlockCBC) Decrypt ¶
func (this CipherBlockCBC) Decrypt(password, params, ciphertext []byte) ([]byte, error)
解密
func (CipherBlockCBC) Encrypt ¶
func (this CipherBlockCBC) Encrypt(password, plaintext []byte) ([]byte, []byte, error)
加密
func (CipherBlockCBC) WithSaltSize ¶ added in v1.0.1033
func (this CipherBlockCBC) WithSaltSize(saltSize int) CipherBlockCBC
设置 saltSize
type CipherRC4 ¶
type CipherRC4 struct {
// contains filtered or unexported fields
}
rc4 模式加密
func (CipherRC4) WithSaltSize ¶ added in v1.0.1033
设置 saltSize
Click to show internal directories.
Click to hide internal directories.