func (s *Store) ImportMissingPublicKeys(ctx context.Context) error {
	if _, ok := s.crypto.(*age.Age); ok {
		debug.Log("not importing public keys for age")
		return nil
	}
	rs, err := s.GetRecipients(ctx, "")
	if err != nil {
		return fmt.Errorf("failed to get recipients: %w", err)
	}
	for _, r := range rs {
		debug.Log("Checking recipients %s ...", r)
		kl, err := s.crypto.FindRecipients(ctx, r)
		if err != nil {
			out.Errorf(ctx, "[%s] Failed to get public key for %s: %s", s.alias, r, err)
		}
		if len(kl) > 0 {
			debug.Log("[%s] Keyring contains %d public keys for %s", s.alias, len(kl), r)
			continue
		}
		names, err := s.decodePublicKey(ctx, r)
		if err != nil {
			out.Errorf(ctx, "[%s] Failed to decode public key %s: %s", s.alias, r, err)
			continue
		}
		if imf := ctxutil.GetImportFunc(ctx); imf != nil {
			if !imf(ctx, r, names) {
				continue
			}
		}
		debug.Log("[%s] Public Key %s not found in keyring, importing", s.alias, r)
		if err := s.importPublicKey(ctx, r); err != nil {
			out.Errorf(ctx, "[%s] Failed to import public key for %s: %s", s.alias, r, err)
			continue
		}
		out.Printf(ctx, "[%s] Imported public key for %s into Keyring", s.alias, r)
	}
	return nil
}
ImportMissingPublicKeys will try to import any missing public keys from the
.public-keys folder in the password store
package leaf
import (
	"context"
	"fmt"
	"path/filepath"
	"github.com/gopasspw/gopass/internal/backend"
	"github.com/gopasspw/gopass/internal/backend/crypto/age"
	"github.com/gopasspw/gopass/internal/out"
	"github.com/gopasspw/gopass/pkg/ctxutil"
	"github.com/gopasspw/gopass/pkg/debug"
)
func (s *Store) initCryptoBackend(ctx context.Context) error {
	cb, err := backend.DetectCrypto(ctx, s.storage)
	if err != nil {
		return err
	}
	s.crypto = cb
	return nil
}
func (s *Store) Crypto() backend.Crypto {
	return s.crypto
}