Documentation ¶
Index ¶
- func GenerateComponentsFromKey(genericKey any) ([]cdx.Component, error)
- func GenerateComponentsFromPEMKeyBlock(block *pem.Block) ([]cdx.Component, error)
- func ParsePEMToBlocksWithTypeFilter(raw []byte, filter Filter) map[*pem.Block]PEMBlockType
- func ParsePEMToBlocksWithTypes(raw []byte) map[*pem.Block]PEMBlockType
- type Filter
- type PEMBlockType
- type PEMTypeFilterType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateComponentsFromPEMKeyBlock ¶
Generate cyclonedx-go components from a block containing a key
func ParsePEMToBlocksWithTypeFilter ¶
func ParsePEMToBlocksWithTypeFilter(raw []byte, filter Filter) map[*pem.Block]PEMBlockType
Just like ParsePEMToBlocksWithTypes but uses a filter for filtering
func ParsePEMToBlocksWithTypes ¶
func ParsePEMToBlocksWithTypes(raw []byte) map[*pem.Block]PEMBlockType
Parse a the []byte of a PEM file to a map containing the *pem.Block and a PEMBlockType for each block
Types ¶
type Filter ¶
type Filter struct { FilterType PEMTypeFilterType List []PEMBlockType }
Filter that describes which PEMBlockTypes to allow
type PEMBlockType ¶
type PEMBlockType string
A not complete list of PEMBlockTypes that can be detected currently
const ( PEMBlockTypeCertificate PEMBlockType = "CERTIFICATE" PEMBlockTypePrivateKey PEMBlockType = "PRIVATE KEY" PEMBlockTypeEncryptedPrivateKey PEMBlockType = "ENCRYPTED PRIVATE KEY" PEMBlockTypePublicKey PEMBlockType = "PUBLIC KEY" PEMBlockTypeECPrivateKey PEMBlockType = "EC PRIVATE KEY" PEMBlockTypeRSAPrivateKey PEMBlockType = "RSA PRIVATE KEY" PEMBlockTypeRSAPublicKey PEMBlockType = "RSA PUBLIC KEY" PEMBlockTypeOPENSSHPrivateKey PEMBlockType = "OPENSSH PRIVATE KEY" )
type PEMTypeFilterType ¶
type PEMTypeFilterType bool
Used to specify whether a filter is an allow- or blocklist
const ( PEMTypeFilterTypeAllowlist PEMTypeFilterType = true // Allow List PEMTypeFilterTypeBlocklist PEMTypeFilterType = false // Block List )
Click to show internal directories.
Click to hide internal directories.