mirror of
https://github.com/gopasspw/gopass.git
synced 2025-12-08 19:24:54 +00:00
21 lines
403 B
Go
21 lines
403 B
Go
package root
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/gopasspw/gopass/internal/backend"
|
|
"github.com/gopasspw/gopass/pkg/debug"
|
|
)
|
|
|
|
// Crypto returns the crypto backend.
|
|
func (r *Store) Crypto(ctx context.Context, name string) backend.Crypto {
|
|
sub, _ := r.getStore(name)
|
|
if !sub.Valid() {
|
|
debug.Log("Sub-Store not found for %s. Returning nil crypto backend", name)
|
|
|
|
return nil
|
|
}
|
|
|
|
return sub.Crypto()
|
|
}
|