func (k *KeyringSectionV1) FindMember(id *identity.ID) (*primitive.KeyringMember, *primitive.MEKShare, error) {
	var krm *primitive.KeyringMember
	var mekshare *primitive.MEKShare
	for _, m := range k.Members {
		mbody := m.Body.(*primitive.KeyringMemberV1)
		if *mbody.OwnerID == *id {
			krm = &primitive.KeyringMember{
				OrgID:           mbody.OrgID,
				KeyringID:       mbody.KeyringID,
				OwnerID:         mbody.OwnerID,
				PublicKeyID:     mbody.PublicKeyID,
				EncryptingKeyID: mbody.EncryptingKeyID,
			}

			mekshare = &primitive.MEKShare{
				Key: mbody.Key,
			}
			break
		}
	}

	if krm == nil {
		return nil, nil, ErrMemberNotFound
	}

	return krm, mekshare, nil
}
// FindMember returns the membership and mekshare for the given user id.
// The data is returned in V2 format.
FindMember returns the membership and mekshare for the given user id.
The data is returned in V2 format.
// FindMember returns the membership and mekshare for the given user id . // The data is returned in V2 format .
func (k *KeyringSectionV1) FindMember(id *identity.ID) (*primitive.KeyringMember, *primitive.MEKShare, error) {
	var krm *primitive.KeyringMember
	var mekshare *primitive.MEKShare
	for _, m := range k.Members {
		mbody := m.Body.(*primitive.KeyringMemberV1)
		if *mbody.OwnerID == *id {
			krm = &primitive.KeyringMember{
				OrgID:           mbody.OrgID,
				KeyringID:       mbody.KeyringID,
				OwnerID:         mbody.OwnerID,
				PublicKeyID:     mbody.PublicKeyID,
				EncryptingKeyID: mbody.EncryptingKeyID,
			}
			mekshare = &primitive.MEKShare{
				Key: mbody.Key,
			}
			break
		}
	}
	if krm == nil {
		return nil, nil, ErrMemberNotFound
	}
	return krm, mekshare, nil
}
func ( k * KeyringSectionV1 ) FindMember ( id * identity . ID ) ( * primitive . KeyringMember , * primitive . MEKShare , error ) { var krm * primitive . KeyringMember var mekshare * primitive . MEKShare for _ , m := range k . Members { mbody := m . Body . ( * primitive . KeyringMemberV1 ) if * mbody . OwnerID == * id { krm = & primitive . KeyringMember { OrgID : mbody . OrgID , KeyringID : mbody . KeyringID , OwnerID : mbody . OwnerID , PublicKeyID : mbody . PublicKeyID , EncryptingKeyID : mbody . EncryptingKeyID , } mekshare = & primitive . MEKShare { Key : mbody . Key , } break } } if krm == nil { return nil , nil , ErrMemberNotFound } return krm , mekshare , nil }
FindMember returns the membership and mekshare for the given user id.
FindMember returns the membership and mekshare for the given user id .