code: func getPackageFromFile(ccpackfile string) (proto.Message, *pb.ChaincodeDeploymentSpec, error) {
  	b, err := ioutil.ReadFile(ccpackfile)
  	if err != nil {
  		return nil, nil, err
  	}
  
  	//the bytes should be a valid package (CDS or SignedCDS)
  	ccpack, err := ccprovider.GetCCPackage(b)
  	if err != nil {
  		return nil, nil, err
  	}
  
  	//either CDS or Envelope
  	o := ccpack.GetPackageObject()
  
  	//try CDS first
  	cds, ok := o.(*pb.ChaincodeDeploymentSpec)
  	if !ok || cds == nil {
  		//try Envelope next
  		env, ok := o.(*pcommon.Envelope)
  		if !ok || env == nil {
  			return nil, nil, fmt.Errorf("error extracting valid chaincode package")
  		}
  
  		//this will check for a valid package Envelope
  		_, sCDS, err := ccpackage.ExtractSignedCCDepSpec(env)
  		if err != nil {
  			return nil, nil, fmt.Errorf("error extracting valid signed chaincode package(%s)", err)
  		}
  
  		//...and get the CDS at last
  		cds, err = utils.GetChaincodeDeploymentSpec(sCDS.ChaincodeDeploymentSpec, platformRegistry)
  		if err != nil {
  			return nil, nil, fmt.Errorf("error extracting chaincode deployment spec(%s)", err)
  		}
  	}
  
  	return o, cds, nil
  }
docs: //getPackageFromFile get the chaincode package from file and the extracted ChaincodeDeploymentSpec