func NewConnectorFileSystemKeyStore(directory string, clientID []byte, encryptor keystore.KeyEncryptor, mode connector_mode.ConnectorMode) (*ConnectorFileSystemKeyStore, error) {
	return &ConnectorFileSystemKeyStore{directory: directory, clientID: clientID, storage: &fileStorage{}, encryptor: encryptor, connectorMode: mode}, nil
}
NewConnectorFileSystemKeyStore creates new ConnectorFileSystemKeyStore
package filesystem
import (
	"errors"
	"path/filepath"
	connector_mode "github.com/cossacklabs/acra/cmd/acra-connector/connector-mode"
	"github.com/cossacklabs/acra/keystore"
	"github.com/cossacklabs/themis/gothemis/keys"
)
type ConnectorFileSystemKeyStore struct {
	directory     string
	clientID      []byte
	storage       Storage
	encryptor     keystore.KeyEncryptor
	connectorMode connector_mode.ConnectorMode
}
type ConnectorFileSystemKeyStoreBuilder struct {
	directory     string
	clientID      []byte
	storage       Storage
	encryptor     keystore.KeyEncryptor
	connectorMode connector_mode.ConnectorMode
}
func NewCustomConnectorFileSystemKeyStore() *ConnectorFileSystemKeyStoreBuilder {
	return &ConnectorFileSystemKeyStoreBuilder{
		storage: &DummyStorage{},
	}
}
var (
	errNoClientID      = errors.New("client ID not specified")
	errNoConnectorMode = errors.New("connector mode not specified")
)
func (b *ConnectorFileSystemKeyStoreBuilder) KeyDirectory(directory string) *ConnectorFileSystemKeyStoreBuilder {
	b.directory = directory
	return b
}
func (b *ConnectorFileSystemKeyStoreBuilder) ClientID(clientID []byte) *ConnectorFileSystemKeyStoreBuilder {
	b.clientID = clientID
	return b
}
func (b *ConnectorFileSystemKeyStoreBuilder) Storage(storage Storage) *ConnectorFileSystemKeyStoreBuilder {
	b.storage = storage
	return b
}
func (b *ConnectorFileSystemKeyStoreBuilder) Encryptor(encryptor keystore.KeyEncryptor) *ConnectorFileSystemKeyStoreBuilder {
	b.encryptor = encryptor
	return b
}
func (b *ConnectorFileSystemKeyStoreBuilder) ConnectorMode(connectorMode connector_mode.ConnectorMode) *ConnectorFileSystemKeyStoreBuilder {
	b.connectorMode = connectorMode
	return b
}
func (b *ConnectorFileSystemKeyStoreBuilder) Build() (*ConnectorFileSystemKeyStore, error) {
	if b.directory == "" {
		return nil, errNoPrivateKeyDir
	}
	if b.clientID == nil {
		return nil, errNoClientID
	}
	if b.encryptor == nil {
		return nil, errNoEncryptor
	}
	if b.connectorMode == "" {
		return nil, errNoConnectorMode
	}
	return &ConnectorFileSystemKeyStore{
		directory:     b.directory,
		clientID:      b.clientID,
		storage:       b.storage,
		encryptor:     b.encryptor,
		connectorMode: b.connectorMode,
	}, nil
}