ageencryptionservice

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: AGPL-3.0 Imports: 7 Imported by: 1

Documentation

Overview

Package ageencryptionservice contains the age encryption service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncryptBytes

func EncryptBytes(publicKey string, plaintext []byte) ([]byte, error)

EncryptBytes encrypts a byte array using the age encryption library

func EncryptString

func EncryptString(publicKey string, plaintext string) (string, error)

EncryptString encrypts a string using the age encryption library

func NewAgeEncryptionService

func NewAgeEncryptionService() interfaces.AgeEncryptionServiceInterface

NewAgeEncryptionService creates a new age encryption service wrapper

func ValidRecipient

func ValidRecipient(publicKey string) bool

ValidRecipient reports whether this package can encrypt to publicKey: it parses, and wrapping a throwaway file key catches keys that parse but cannot be encrypted to (the all-zero point).

Types

type MockAgeEncryptionService

type MockAgeEncryptionService struct {
	mock.Mock
}

MockAgeEncryptionService provides a mock implementation of age encryption service

func (*MockAgeEncryptionService) EncryptBytes

func (m *MockAgeEncryptionService) EncryptBytes(publicKey string, plaintext []byte) ([]byte, error)

EncryptBytes encrypts a byte array using the age encryption library

func (*MockAgeEncryptionService) EncryptString

func (m *MockAgeEncryptionService) EncryptString(publicKey string, plaintext string) (string, error)

EncryptString encrypts a string using the age encryption library

type Wrapper

type Wrapper struct{}

Wrapper wraps the existing age encryption functionality

func (*Wrapper) EncryptBytes

func (a *Wrapper) EncryptBytes(publicKey string, plaintext []byte) ([]byte, error)

EncryptBytes encrypts a byte array using the age encryption library

func (*Wrapper) EncryptString

func (a *Wrapper) EncryptString(publicKey string, plaintext string) (string, error)

EncryptString encrypts a string using the age encryption library

Directories

Path Synopsis
Package ageinterfaces contains the interfaces for the age encryption service
Package ageinterfaces contains the interfaces for the age encryption service

Jump to

Keyboard shortcuts

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