Documentation
¶
Index ¶
- func IsTarFile(path string) bool
- type GPGHandler
- func (g *GPGHandler) Decrypt(reader io.Reader) (io.Reader, error)
- func (g *GPGHandler) Encrypt(writer io.Writer) (io.WriteCloser, error)
- func (g *GPGHandler) IsEncrypted(data []byte) bool
- func (g *GPGHandler) ListKeys() ([]string, error)
- func (g *GPGHandler) Sign(filePath, signaturePath string) error
- func (g *GPGHandler) Verify(filePath, signaturePath string) error
- type TarArchive
- type TarFileInfo
- type TarOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GPGHandler ¶
GPGHandler handles GPG encryption, decryption, signing, and verification
func NewGPGHandler ¶
func NewGPGHandler(keyringPath, keyID string) (*GPGHandler, error)
NewGPGHandler creates a new GPG handler
func (*GPGHandler) Encrypt ¶
func (g *GPGHandler) Encrypt(writer io.Writer) (io.WriteCloser, error)
Encrypt encrypts data using GPG and returns a WriteCloser
func (*GPGHandler) IsEncrypted ¶
func (g *GPGHandler) IsEncrypted(data []byte) bool
IsEncrypted checks if data appears to be GPG encrypted
func (*GPGHandler) ListKeys ¶
func (g *GPGHandler) ListKeys() ([]string, error)
ListKeys lists available GPG keys
func (*GPGHandler) Sign ¶
func (g *GPGHandler) Sign(filePath, signaturePath string) error
Sign creates a detached GPG signature for a file
func (*GPGHandler) Verify ¶
func (g *GPGHandler) Verify(filePath, signaturePath string) error
Verify verifies a detached GPG signature
type TarArchive ¶
type TarArchive struct {
Path string
Options TarOptions
// contains filtered or unexported fields
}
TarArchive represents a TAR archive with optional encryption and signing
func New ¶
func New(path string, options TarOptions) (*TarArchive, error)
New creates a new TarArchive instance
func (*TarArchive) Create ¶
func (ta *TarArchive) Create(sourceDir string) error
Create creates a TAR archive from the specified source directory
func (*TarArchive) Extract ¶
func (ta *TarArchive) Extract(destDir string) error
Extract extracts the TAR archive to the specified destination directory
func (*TarArchive) GetFileExtension ¶
func (ta *TarArchive) GetFileExtension() string
GetFileExtension returns the appropriate file extension for the archive
func (*TarArchive) IsEncrypted ¶
func (ta *TarArchive) IsEncrypted() (bool, error)
IsEncrypted checks if the TAR archive appears to be encrypted
func (*TarArchive) List ¶
func (ta *TarArchive) List() ([]TarFileInfo, error)
List returns a list of files in the TAR archive
type TarFileInfo ¶
FileInfo represents a file in the TAR archive
type TarOptions ¶
type TarOptions struct {
Compression bool // Use gzip compression
GPGEncrypt bool // Encrypt the TAR file with GPG
GPGSign bool // Sign the TAR file with GPG
GPGKeyID string // GPG key ID for encryption/signing
GPGKeyring string // Path to GPG keyring
Verbose bool // Verbose output
}
TarOptions holds configuration for TAR operations
func ParseTarOptions ¶
func ParseTarOptions(path string) TarOptions
ParseTarOptions determines TAR options from file extension