pem

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCdxComponents

func GenerateCdxComponents(block *pem.Block) ([]cdx.Component, error)

GenerateCdxComponents Generate cyclone-go components from a block containing a key

func ParsePEMToBlocksWithTypeFilter

func ParsePEMToBlocksWithTypeFilter(raw []byte, filter Filter) map[*pem.Block]BlockType

ParsePEMToBlocksWithTypeFilter Just like ParsePEMToBlocksWithTypes but uses a filter for filtering

Types

type BlockType

type BlockType string

BlockType A not complete list of PEMBlockTypes that can be detected currently

const (
	BlockTypeCertificate         BlockType = "CERTIFICATE"
	BlockTypePrivateKey          BlockType = "PRIVATE KEY"
	BlockTypeEncryptedPrivateKey BlockType = "ENCRYPTED PRIVATE KEY"
	BlockTypePublicKey           BlockType = "PUBLIC KEY"
	BlockTypeECPrivateKey        BlockType = "EC PRIVATE KEY"
	BlockTypeRSAPrivateKey       BlockType = "RSA PRIVATE KEY"
	BlockTypeRSAPublicKey        BlockType = "RSA PUBLIC KEY"
	BlockTypeOPENSSHPrivateKey   BlockType = "OPENSSH PRIVATE KEY"
)

type Filter

type Filter struct {
	FilterType TypeFilterType
	List       []BlockType
}

Filter that describes which PEMBlockTypes to allow

type TypeFilterType

type TypeFilterType bool

TypeFilterType Used to specify whether a filter is an allow- or blocklist

const (
	TypeAllowlist TypeFilterType = true  // Allowlist
	TypeBlocklist TypeFilterType = false // Blocklist
)

Jump to

Keyboard shortcuts

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