Documentation ¶
Index ¶
- Variables
- func IsShEncFile(in string) (bool, error)
- type App
- func (a *App) AddKeyList(in string)
- func (a *App) AddPublicKey(in, name string)
- func (a *App) DecryptFile(in, out string)
- func (a *App) EncryptFile(in, out string, members []string)
- func (a *App) GenerateFileKey(out string, fileID [16]byte, members []string) (domain.UserInfo, []domain.UserInfo, error)
- func (a *App) ListPublicKeys()
- func (a *App) RemovePublicKey(name string)
- func (a *App) ShowFileInfo(in string)
- func (a *App) UpdateFile(base, in, out string)
- type KeyStore
- func (s *KeyStore) AddFileKey(keylist domain.KeyListFile) error
- func (s *KeyStore) AddPublicKey(key keys.PublicKey, name string) error
- func (s *KeyStore) GetByFingerprint(fingerprint string) (keys.PublicKey, error)
- func (s *KeyStore) GetByName(name string) (keys.PublicKey, error)
- func (s *KeyStore) GetFileKey(fileid, ownerfp string) (keys.PrivateKey, error)
- func (s *KeyStore) GetMyPrivateKey() (keys.PrivateKey, error)
- func (s *KeyStore) GetMyPublicKey() (keys.PublicKey, error)
- func (s *KeyStore) GetNameByFingerprint(fingerprint string) string
- func (s *KeyStore) RemovePublicKey(fingerprint string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAlreadyExists = errors.New("already exists")
View Source
var ErrBadPermission = errors.New("bad file/dir permission")
View Source
var ErrInvalidData = errors.New("invalid data")
View Source
var ErrNotDir = errors.New("not a directory")
View Source
var ErrNotFile = errors.New("not a regular file")
View Source
var ErrPrivateKeyNotFound = errors.New("private key not found")
View Source
var ErrUnknownUser = fmt.Errorf("unknown user")
Functions ¶
func IsShEncFile ¶
Types ¶
type App ¶
type App struct {
Store *KeyStore
}
func (*App) AddKeyList ¶
func (*App) AddPublicKey ¶
func (*App) DecryptFile ¶
func (*App) EncryptFile ¶
func (*App) GenerateFileKey ¶
func (*App) ListPublicKeys ¶
func (a *App) ListPublicKeys()
func (*App) RemovePublicKey ¶
func (*App) ShowFileInfo ¶
func (*App) UpdateFile ¶
type KeyStore ¶
type KeyStore struct { Confd string // App config directory Keyd string // Owner's key directory Pubkeyf string // Owner's public key file Prvkeyf string // Owner's private key file Knownkeyd string // Known (member's) keys directory Keylistf string // Known (member's) list Filed string // file data directory // contains filtered or unexported fields }
func NewKeyStore ¶
NewKeyStore creates a new KeyStore instance. If conf dir is not exist, creates it. If private key is not exist, return store with ErrPrivateKeyNotFound.
func (*KeyStore) AddFileKey ¶
func (s *KeyStore) AddFileKey(keylist domain.KeyListFile) error
func (*KeyStore) AddPublicKey ¶
func (*KeyStore) GetByFingerprint ¶
func (*KeyStore) GetFileKey ¶
func (s *KeyStore) GetFileKey(fileid, ownerfp string) (keys.PrivateKey, error)
func (*KeyStore) GetMyPrivateKey ¶
func (s *KeyStore) GetMyPrivateKey() (keys.PrivateKey, error)
func (*KeyStore) GetNameByFingerprint ¶
func (*KeyStore) RemovePublicKey ¶
Click to show internal directories.
Click to hide internal directories.