pkcs8pbe

package
v1.0.2028 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 8 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
)
View Source
var (
	// pkcs12 模式
	SHA1And3DES    = pbes1.SHA1And3DES
	SHA1And2DES    = pbes1.SHA1And2DES
	SHA1AndRC2_128 = pbes1.SHA1AndRC2_128
	SHA1AndRC2_40  = pbes1.SHA1AndRC2_40
	SHA1AndRC4_128 = pbes1.SHA1AndRC4_128
	SHA1AndRC4_40  = pbes1.SHA1AndRC4_40

	// pkcs5-v1.5 模式
	MD2AndDES     = pbes1.MD2AndDES
	MD2AndRC2_64  = pbes1.MD2AndRC2_64
	MD5AndDES     = pbes1.MD5AndDES
	MD5AndRC2_64  = pbes1.MD5AndRC2_64
	SHA1AndDES    = pbes1.SHA1AndDES
	SHA1AndRC2_64 = pbes1.SHA1AndRC2_64
)

加密方式

Functions

func DecryptPEMBlock

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

解出 PEM 块

func DecryptPKCS8PrivateKey

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

Types

type Cipher added in v1.0.2011

type Cipher = pbes1.Cipher

别名

Jump to

Keyboard shortcuts

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