pem

package
v1.0.4033 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// 编码
	// Encode(out io.Writer, b *Block) error
	Encode = pem.Encode

	// 编码
	// EncodeToMemory(b *Block) []byte
	EncodeToMemory = pem.EncodeToMemory

	// 解码
	// Decode(data []byte) (p *Block, rest []byte)
	Decode = pem.Decode
)
View Source
var PEMTypeMap = map[string]string{
	"pri_key":     "PRIVATE KEY",
	"enc_pri_key": "ENCRYPTED PRIVATE KEY",
	"pub_key":     "PUBLIC KEY",

	"ec_pri_key":  "EC PRIVATE KEY",
	"dsa_pri_key": "DSA PRIVATE KEY",
	"rsa_pri_key": "RSA PRIVATE KEY",
}

PEM Type 列表 PEM Type list

Functions

func EncodeToPEM

func EncodeToPEM(data []byte, blockType string) []byte

编码字节数据为 PEM 证书 Encode bytes to PEM cert

func GetPEMType

func GetPEMType(name string) string

获取 PEM 类型 get PEM type name

func ParsePEM

func ParsePEM(data []byte) ([]byte, error)

解析 PEM 证书 parse PEM cert

Types

type Block

type Block = pem.Block

Block

Jump to

Keyboard shortcuts

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