// DeserializeIdentity mockcore deserialize identity
961035
func (m *MockMSP) DeserializeIdentity(serializedIdentity []byte) (msp.Identity, error) {
	if m.Err != nil && m.Err.Error() == "DeserializeIdentity" {
		return nil, m.Err
	}
	return &MockIdentity{Err: m.Err}, nil
}
750100
func (s *RegisterUserInput) SetIdentityType(v string) *RegisterUserInput {
	s.IdentityType = &v
	return s
}
963351
func (m MockContext) Identifier() *msp.IdentityIdentifier {
	return &msp.IdentityIdentifier{ID: m.SigningIdentity.Identifier().ID, MSPID: m.SigningIdentity.Identifier().MSPID}
}
899315
func (l *localIdentityCache) GetIdentities() map[identity.NumericIdentity]*identity.Identity {
	cache := map[identity.NumericIdentity]*identity.Identity{}

	l.mutex.RLock()
	defer l.mutex.RUnlock()

	for key, id := range l.identitiesByID {
		cache[key] = id
	}

	return cache
}
1347702
func (id *MockIdentity) Verify(msg []byte, sig []byte) error {
	if id.Err != nil && id.Err.Error() == "Verify" {
		return id.Err
	}
	return nil
}
97881
func NewIdentity() *IdentityClient {
	c := &IdentityClient{}
	c.common.backend = DefaultBackend()

	c.Analytics = (*AnalyticsClient)(&c.common)
	c.Invites = (*InvitesClient)(&c.common)
	c.Memberships = (*MembershipsClient)(&c.common)
	c.Self = (*SelfClient)(&c.common)
	c.Teams = (*TeamsClient)(&c.common)
	c.Tokens = (*TokensClient)(&c.common)
	c.Users = (*UsersClient)(&c.common)

	return c
}
1142306
func (c *ACLCaches) GetIdentity(id string) *IdentityCacheEntry {
	if c == nil || c.identities == nil {
		return nil
	}

	if raw, ok := c.identities.Get(id); ok {
		return raw.(*IdentityCacheEntry)
	}

	return nil
}
765978
func (_m *IdentityDeserializer) DeserializeIdentity(serializedIdentity []byte) (msp.Identity, error) {
	ret := _m.Called(serializedIdentity)

	var r0 msp.Identity
	if rf, ok := ret.Get(0).(func([]byte) msp.Identity); ok {
		r0 = rf(serializedIdentity)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(msp.Identity)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func([]byte) error); ok {
		r1 = rf(serializedIdentity)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
571486
func (defaultNodeIdentifier) NodeIdentity(u user.Info) (string, bool) {
	// Make sure we're a node, and can parse the node name
	if u == nil {
		return "", false
	}

	userName := u.GetName()
	if !strings.HasPrefix(userName, nodeUserNamePrefix) {
		return "", false
	}

	isNode := false
	for _, g := range u.GetGroups() {
		if g == user.NodesGroup {
			isNode = true
			break
		}
	}
	if !isNode {
		return "", false
	}

	nodeName := strings.TrimPrefix(userName, nodeUserNamePrefix)
	return nodeName, true
}
53763
func (s *PollForActivityTaskInput) SetIdentity(v string) *PollForActivityTaskInput {
	s.Identity = &v
	return s
}
1259049
func updateIdentity(set *apps.StatefulSet, pod *v1.Pod) {
	pod.Name = getPodName(set, getOrdinal(pod))
	pod.Namespace = set.Namespace
	if pod.Labels == nil {
		pod.Labels = make(map[string]string)
	}
	pod.Labels[apps.StatefulSetPodNameLabel] = pod.Name
}
299388
func (m MockContext) Verify(msg []byte, sig []byte) error {
	if m.SigningIdentity == nil {
		return errors.New("anonymous countext")
	}
	return m.SigningIdentity.Verify(msg, sig)
}
1177607
func (m *MockMSP) GetSigningIdentity(identifier *msp.IdentityIdentifier) (msp.SigningIdentity, error) {
	return nil, nil
}
755448
func (m *MockConfig) SystemIdentityPath() string {
	ret := m.ctrl.Call(m, "SystemIdentityPath")
	ret0, _ := ret[0].(string)
	return ret0
}
535917
func (c *clientIdentityImpl) getIdentity() (*msp.SerializedIdentity, error) {
	sid := &msp.SerializedIdentity{}
	creator, err := c.stub.GetCreator()
	if err != nil || creator == nil {
		return nil, errors.WithMessage(err, "failed to get transaction invoker's identity from the chaincode stub")
	}
	err = proto.Unmarshal(creator, sid)
	if err != nil {
		return nil, errors.Wrap(err, "failed to unmarshal transaction invoker's identity")
	}
	return sid, nil
}
425497
func (soc *Socket) SetIdentity(value string) error {
	return soc.setString(C.ZMQ_IDENTITY, value)
}
90665
func (a *Client) GetIdentity(params *GetIdentityParams) (*GetIdentityOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetIdentityParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetIdentity",
		Method:             "GET",
		PathPattern:        "/identity",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &GetIdentityReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetIdentityOK), nil

}