code: func SignExistingPackage(env *common.Envelope, owner msp.SigningIdentity) (*common.Envelope, error) {
  	if owner == nil {
  		return nil, fmt.Errorf("owner not provided")
  	}
  
  	ch, sdepspec, err := ExtractSignedCCDepSpec(env)
  	if err != nil {
  		return nil, err
  	}
  
  	if ch == nil {
  		return nil, fmt.Errorf("channel header not found in the envelope")
  	}
  
  	if sdepspec == nil || sdepspec.ChaincodeDeploymentSpec == nil || sdepspec.InstantiationPolicy == nil || sdepspec.OwnerEndorsements == nil {
  		return nil, fmt.Errorf("invalid signed deployment spec")
  	}
  
  	// serialize the signing identity
  	endorser, err := owner.Serialize()
  	if err != nil {
  		return nil, fmt.Errorf("Could not serialize the signing identity for %s, err %s", owner.GetIdentifier(), err)
  	}
  
  	// sign the concatenation of cds, instpolicy and the serialized endorser identity with this endorser's key
  	signature, err := owner.Sign(append(sdepspec.ChaincodeDeploymentSpec, append(sdepspec.InstantiationPolicy, endorser...)...))
  	if err != nil {
  		return nil, fmt.Errorf("Could not sign the ccpackage, err %s", err)
  	}
  
  	endorsements := append(sdepspec.OwnerEndorsements, &peer.Endorsement{Signature: signature, Endorser: endorser})
  
  	return createSignedCCDepSpec(sdepspec.ChaincodeDeploymentSpec, sdepspec.InstantiationPolicy, endorsements)
  }
docs: // SignExistingPackage adds a signature to a signed package.