pbes1

package
v1.0.5006 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AddCipher = pbes1.AddCipher
	GetCipher = pbes1.GetCipher

	// 帮助函数
	GetCipherFromName   = pbes1.GetCipherFromName
	CheckCipherFromName = pbes1.CheckCipherFromName
	GetCipherName       = pbes1.GetCipherName
	CheckCipher         = pbes1.CheckCipher
)
View Source
var (
	// pkcs12
	SHA1AndRC4_128 = pbes1.SHA1AndRC4_128
	SHA1AndRC4_40  = pbes1.SHA1AndRC4_40
	SHA1And3DES    = pbes1.SHA1And3DES
	SHA1And2DES    = pbes1.SHA1And2DES
	SHA1AndRC2_128 = pbes1.SHA1AndRC2_128
	SHA1AndRC2_40  = pbes1.SHA1AndRC2_40

	MD5AndCAST5   = pbes1.MD5AndCAST5
	SHAAndTwofish = pbes1.SHAAndTwofish

	// PBES1
	MD2AndDES     = pbes1.MD2AndDES
	MD2AndRC2_64  = pbes1.MD2AndRC2_64
	MD5AndDES     = pbes1.MD5AndDES
	MD5AndRC2_64  = pbes1.MD5AndRC2_64
	SHA1AndDES    = pbes1.SHA1AndDES
	SHA1AndRC2_64 = pbes1.SHA1AndRC2_64
)

加密方式

View Source
var BmpStringZeroTerminated = bmp_string.BmpStringZeroTerminated

BmpStringZeroTerminated returns s encoded in UCS-2 with a zero terminator.

Functions

func DecryptPEMBlock

func DecryptPEMBlock(block *pem.Block, password []byte) ([]byte, error)

解出 PEM 块

func DecryptPKCS8PrivateKey

func DecryptPKCS8PrivateKey(data, password []byte) ([]byte, error)

解出 PKCS8 私钥

func DecryptPKCS8Privatekey added in v1.0.2032

func DecryptPKCS8Privatekey(data, password []byte) ([]byte, error)

解出 PKCS8 私钥,不处理密码

func EncryptPKCS8PrivateKey

func EncryptPKCS8PrivateKey(
	rand io.Reader,
	blockType string,
	data []byte,
	password []byte,
	cipher Cipher,
) (*pem.Block, error)

加密 PKCS8 私钥

func EncryptPKCS8Privatekey added in v1.0.2032

func EncryptPKCS8Privatekey(
	rand io.Reader,
	blockType string,
	data []byte,
	password []byte,
	cipher Cipher,
) (*pem.Block, error)

加密 PKCS8 私钥,不处理密码

Types

type Cipher

type Cipher = pbes1.Cipher

别名

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL