func (kp *Keypairs) Add(keypairs ...ClaimedKeyPair) error {
	for _, k := range keypairs {
		kp.idIndex[*k.PublicKey.ID] = k
		orgID := *k.PublicKey.Body.OrgID
		_, ok := kp.keypairs[orgID]
		if !ok {
			kp.keypairs[orgID] = []ClaimedKeyPair{k}
			continue
		}
		kp.keypairs[orgID] = append(kp.keypairs[orgID], k)
	}
	return nil
}
Add adds the given keypairs to the list of keypairs
package registry
import (
	"context"
	"errors"
	"net/url"
	"github.com/manifoldco/torus-cli/apitypes"
	"github.com/manifoldco/torus-cli/envelope"
	"github.com/manifoldco/torus-cli/identity"
	"github.com/manifoldco/torus-cli/primitive"
)
var ErrPublicKeyNotFound = &apitypes.Error{
	Type: apitypes.NotFoundError,
	Err:  []string{"Could not find public key"},
}
var ErrMissingValidKeypair = &apitypes.Error{
	Type: apitypes.NotFoundError,
	Err:  []string{"Missing encryption or signing keypairs"},
}
var ErrMissingKeysForOrg = &apitypes.Error{
	Type: apitypes.NotFoundError,
	Err:  []string{"Could not find keypairs for org"},
}
type Keypairs struct {
	keypairs map[identity.ID][]ClaimedKeyPair
	idIndex  map[identity.ID]ClaimedKeyPair
}
func NewKeypairs() *Keypairs {
	return &Keypairs{
		keypairs: map[identity.ID][]ClaimedKeyPair{},
		idIndex:  map[identity.ID]ClaimedKeyPair{},
	}
}