Documentation ¶
Index ¶
- Constants
- type XC
- func (x *XC) CreatePrivateKey(ctx context.Context) error
- func (x *XC) CreatePrivateKeyBatch(ctx context.Context, name, email, passphrase string) error
- func (x *XC) Decrypt(ctx context.Context, buf []byte) ([]byte, error)
- func (x *XC) DecryptStream(ctx context.Context, ciphertext io.Reader, plaintext io.Writer) error
- func (x *XC) EmailFromKey(ctx context.Context, id string) string
- func (x *XC) Encrypt(ctx context.Context, plaintext []byte, recipients []string) ([]byte, error)
- func (x *XC) EncryptStream(ctx context.Context, plaintext io.Reader, recipients []string, ...) error
- func (x *XC) ExportPrivateKey(ctx context.Context, id string) ([]byte, error)
- func (x *XC) ExportPublicKey(ctx context.Context, id string) ([]byte, error)
- func (x *XC) Ext() string
- func (x *XC) FindPrivateKeys(ctx context.Context, search ...string) ([]string, error)
- func (x *XC) FindPublicKeys(ctx context.Context, search ...string) ([]string, error)
- func (x *XC) Fingerprint(ctx context.Context, id string) string
- func (x *XC) FormatKey(ctx context.Context, id string) string
- func (x *XC) IDFile() string
- func (x *XC) ImportPrivateKey(ctx context.Context, buf []byte) error
- func (x *XC) ImportPublicKey(ctx context.Context, buf []byte) error
- func (x *XC) Initialized(ctx context.Context) error
- func (x *XC) ListPrivateKeyIDs(ctx context.Context) ([]string, error)
- func (x *XC) ListPublicKeyIDs(ctx context.Context) ([]string, error)
- func (x *XC) Name() string
- func (x *XC) NameFromKey(ctx context.Context, id string) string
- func (x *XC) ReadNamesFromKey(ctx context.Context, buf []byte) ([]string, error)
- func (x *XC) RecipientIDs(ctx context.Context, ciphertext []byte) ([]string, error)
- func (x *XC) RemoveKey(id string) error
- func (x *XC) Version(ctx context.Context) semver.Version
Constants ¶
const ( // Ext is the extension used by this backend Ext = "xc" // IDFile is the recipients list used by this backend IDFile = ".xc-ids" )
const (
// OnDiskVersion is the version of our on-disk format
OnDiskVersion = 1
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type XC ¶
type XC struct {
// contains filtered or unexported fields
}
XC is an experimental crypto backend
func (*XC) CreatePrivateKey ¶
CreatePrivateKey is not implemented
func (*XC) CreatePrivateKeyBatch ¶
CreatePrivateKeyBatch creates a new keypair
func (*XC) DecryptStream ¶
DecryptStream decrypts an stream encrypted with EncryptStream
func (*XC) EmailFromKey ¶
EmailFromKey extracts the email from a key
func (*XC) Encrypt ¶
Encrypt encrypts the given plaintext for all the given recipients and returns the ciphertext
func (*XC) EncryptStream ¶
func (x *XC) EncryptStream(ctx context.Context, plaintext io.Reader, recipients []string, ciphertext io.Writer) error
EncryptStream encrypts the plaintext using a slightly modified on disk-format suitable for streaming
func (*XC) ExportPrivateKey ¶
ExportPrivateKey exports a given private key
func (*XC) ExportPublicKey ¶
ExportPublicKey exports a given public key
func (*XC) FindPrivateKeys ¶
FindPrivateKeys finds all matching private keys
func (*XC) FindPublicKeys ¶
FindPublicKeys finds all matching public keys
func (*XC) Fingerprint ¶
Fingerprint returns the full-length native fingerprint
func (*XC) ImportPrivateKey ¶
ImportPrivateKey imports a given private key into the keyring
func (*XC) ImportPublicKey ¶
ImportPublicKey imports a given public key into the keyring
func (*XC) Initialized ¶
Initialized returns an error if this backend is not properly initialized
func (*XC) ListPrivateKeyIDs ¶
ListPrivateKeyIDs lists all private key IDs
func (*XC) ListPublicKeyIDs ¶
ListPublicKeyIDs lists all public key IDs
func (*XC) NameFromKey ¶
NameFromKey extracts the name from a key
func (*XC) ReadNamesFromKey ¶
ReadNamesFromKey unmarshals the given public key and returns the identities name
func (*XC) RecipientIDs ¶
RecipientIDs reads the header of the given file and extracts the recipients IDs