Documentation ¶
Index ¶
- Variables
- func AddCipher(oid asn1.ObjectIdentifier, cipher func() Cipher)
- func CheckCipherFromName(name string) bool
- type Cipher
- 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
Constants ¶
This section is empty.
Variables ¶
View Source
var MD2AndDES = CipherBlockCBC{ // contains filtered or unexported fields }
pkcs5-v1.5 模式
View Source
var MD2AndRC2_64 = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var MD5AndDES = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var MD5AndRC2_64 = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var PEMCipherMap = map[string]Cipher{ "SHA1And3DES": SHA1And3DES, "SHA1And2DES": SHA1And2DES, "SHA1AndRC2_128": SHA1AndRC2_128, "SHA1AndRC2_40": SHA1AndRC2_40, "SHA1AndRC4_128": SHA1AndRC4_128, "SHA1AndRC4_40": SHA1AndRC4_40, "MD2AndDES": MD2AndDES, "MD2AndRC2_64": MD2AndRC2_64, "MD5AndDES": MD5AndDES, "MD5AndRC2_64": MD5AndRC2_64, "SHA1AndDES": SHA1AndDES, "SHA1AndRC2_64": SHA1AndRC2_64, }
PEMCipher 列表
View Source
var SHA1And2DES = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var SHA1And3DES = CipherBlockCBC{ // contains filtered or unexported fields }
pkcs12 模式
View Source
var SHA1AndDES = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var SHA1AndRC2_128 = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var SHA1AndRC2_40 = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var SHA1AndRC2_64 = CipherBlockCBC{ // contains filtered or unexported fields }
View Source
var SHA1AndRC4_128 = CipherRC4{ // contains filtered or unexported fields }
View Source
var SHA1AndRC4_40 = CipherRC4{ // contains filtered or unexported fields }
Functions ¶
Types ¶
type Cipher ¶
type Cipher interface { // oid OID() asn1.ObjectIdentifier // 值大小 KeySize() int // 加密, 返回: [加密后数据, 参数, error] Encrypt(key, plaintext []byte) ([]byte, []byte, error) // 解密 Decrypt(key, params, ciphertext []byte) ([]byte, error) }
加密接口
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 ¶
func (this CipherBlockCBC) WithSaltSize(saltSize int) CipherBlockCBC
设置 saltSize
Click to show internal directories.
Click to hide internal directories.