openssl

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package openssl provides a built-in plugin for analyzing SSL/TLS certificates. It implements the Plugin interface to extract and provide metadata about certificates, including their validity periods, key types, and sizes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateInfo

type CertificateInfo struct {
	File      string    `json:"file"`       // Path to the certificate file
	Subject   string    `json:"subject"`    // Certificate subject DN
	Issuer    string    `json:"issuer"`     // Certificate issuer DN
	NotBefore time.Time `json:"not_before"` // Start of validity period
	NotAfter  time.Time `json:"not_after"`  // End of validity period
	KeyType   string    `json:"key_type"`   // Type of public key (RSA/EC)
	KeySize   int       `json:"key_size"`   // Size of the public key in bits
}

CertificateInfo represents the information extracted from a certificate file. All fields are exported and tagged for JSON serialization to support metadata exchange.

type Plugin

type Plugin struct {
	pb.UnimplementedPluginServer
	// contains filtered or unexported fields
}

Plugin implements the openssl metadata plugin for analyzing SSL/TLS certificates. It can analyze certificate files (cert.pem), chain files (chain.pem), and full chain files (fullchain.pem) based on configuration settings.

func New

func New() *Plugin

New creates a new openssl plugin instance with default settings. By default, only cert.pem analysis is enabled.

func (*Plugin) Close

func (p *Plugin) Close(ctx context.Context, req *pb.CloseRequest) (*pb.CloseResponse, error)

Close performs cleanup when the plugin is being shut down. Currently, this is a no-op as the plugin doesn't maintain any resources that need cleanup.

func (*Plugin) GetMetadata

func (p *Plugin) GetMetadata(ctx context.Context, req *pb.GetMetadataRequest) (*pb.GetMetadataResponse, error)

GetMetadata analyzes certificate files for the specified domain and returns their metadata. It looks for certificate files in the configured certificate directory under the domain's subdirectory. The metadata includes certificate information such as validity period, key type, and size.

func (*Plugin) Initialize

func (p *Plugin) Initialize(ctx context.Context, req *pb.InitializeRequest) (*pb.InitializeResponse, error)

Initialize configures the plugin with the provided settings. It accepts boolean flags to control which certificate files to analyze: - cert: analyze cert.pem files - chain: analyze chain.pem files - fullchain: analyze fullchain.pem files

Jump to

Keyboard shortcuts

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