storage

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileSystemStorage

type FileSystemStorage struct {
	// Path where the certificate file will be stored
	CertPath string
	// Path where the private key file will be stored
	KeyPath string
	// contains filtered or unexported fields
}

FileSystemStorage handles certificate storage on the local filesystem. It stores certificates and private keys as managed files with appropriate permissions and supports loading existing certificates from the filesystem.

func NewFileSystemStorage

func NewFileSystemStorage(certPath, keyPath string, rw fileio.ReadWriter, log provider.Logger) *FileSystemStorage

NewFileSystemStorage creates a new filesystem storage provider with the specified configuration. It uses the provided file I/O interface and logger for operations.

func (*FileSystemStorage) Delete

func (fs *FileSystemStorage) Delete(_ context.Context) error

Delete removes certificate and private key files from the filesystem. It logs warnings if files cannot be deleted but doesn't return errors since deletion is a cleanup operation.

func (*FileSystemStorage) LoadCertificate

func (fs *FileSystemStorage) LoadCertificate(_ context.Context) (*x509.Certificate, error)

func (*FileSystemStorage) Write

func (fs *FileSystemStorage) Write(cert *x509.Certificate, keyPEM []byte) error

Write stores a certificate and private key to the filesystem. It creates the necessary directories and writes both files with appropriate permissions.

type FileSystemStorageConfig

type FileSystemStorageConfig struct {
	// CertPath is the path where the certificate will be stored
	CertPath string `json:"cert-path"`
	// KeyPath is the path where the private key will be stored
	KeyPath string `json:"key-path"`
}

FileSystemStorageConfig defines configuration for filesystem-based certificate storage. It specifies where certificates and private keys should be stored on the filesystem and what permissions should be applied to the files.

type FileSystemStorageFactory

type FileSystemStorageFactory struct {
	// contains filtered or unexported fields
}

FileSystemStorageFactory implements StorageFactory for filesystem-based certificate storage. It creates filesystem storage providers that store certificates and keys as files on disk.

func NewFileSystemStorageFactory

func NewFileSystemStorageFactory(rw fileio.ReadWriter) *FileSystemStorageFactory

NewFileSystemStorageFactory creates a new filesystem storage factory with the specified file I/O interface.

func (*FileSystemStorageFactory) New

New creates a new FileSystemStorage instance from the certificate configuration. It decodes the filesystem-specific configuration and sets appropriate default values.

func (*FileSystemStorageFactory) Type

func (f *FileSystemStorageFactory) Type() string

Type returns the storage type string used as map key in the certificate manager.

func (*FileSystemStorageFactory) Validate

Validate checks whether the provided configuration is valid for filesystem storage. It ensures required fields are present and the configuration is properly formatted.

Jump to

Keyboard shortcuts

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