secretkey

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockSecretKey

type MockSecretKey struct {
	mock.Mock
}

MockSecretKey is a mock implementation of the SecretKeyer interface

func NewMockSecretKey

func NewMockSecretKey() *MockSecretKey

NewMockSecretKey creates a new instance of MockSecretKey

func (*MockSecretKey) Base64

func (m *MockSecretKey) Base64() string

Base64 mocks the Base64 method

func (*MockSecretKey) Decrypt

func (m *MockSecretKey) Decrypt(encryptedMessage string) (string, error)

Decrypt mocks the Decrypt method

func (*MockSecretKey) Encrypt

func (m *MockSecretKey) Encrypt(message string) (string, error)

Encrypt mocks the Encrypt method

func (*MockSecretKey) HashSHA

func (m *MockSecretKey) HashSHA() (string, error)

HashSHA mocks the HashSHA method

type SecretKey

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

func FromBase64

func FromBase64(secretBase64 string) *SecretKey

func New

func New() (*SecretKey, error)

func (SecretKey) Base64

func (s SecretKey) Base64() string

func (SecretKey) Decrypt

func (s SecretKey) Decrypt(encryptedMessage string) (string, error)

func (SecretKey) Encrypt

func (s SecretKey) Encrypt(message string) (string, error)

func (SecretKey) HashSHA

func (s SecretKey) HashSHA() (string, error)

type SecretKeyer

type SecretKeyer interface {
	Base64() string
	HashSHA() (string, error)
	Encrypt(message string) (string, error)
	Decrypt(encryptedMessage string) (string, error)
}

Jump to

Keyboard shortcuts

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