code: func (u *User) Serialize() ([]byte, error) {
  	serializedIdentity := &pb_msp.SerializedIdentity{
  		Mspid:   u.mspID,
  		IdBytes: u.enrollmentCertificate,
  	}
  	identity, err := proto.Marshal(serializedIdentity)
  	if err != nil {
  		return nil, errors.Wrap(err, "marshal serializedIdentity failed")
  	}
  	return identity, nil
  }
docs: // Serialize converts an identity to bytes