public function buildContext()
 {
     $result = parent::buildContext();
     $idpEd = $this->container->getPartyContainer()->getIdpEntityDescriptorStore()->get($this->idpEntityId);
     if (false == $idpEd) {
         throw new \RuntimeException(sprintf('Unknown IDP "%s"', $this->idpEntityId));
     }
     $result->getPartyEntityContext()->setEntityDescriptor($idpEd)->setTrustOptions($this->container->getPartyContainer()->getTrustOptionsStore()->get($this->idpEntityId) ?: new TrustOptions());
     return $result;
 }
 /**
  * @return ProfileContext
  */
 public function buildContext()
 {
     $result = parent::buildContext();
     $result->getPartyEntityContext()->setEntityId($this->entityId);
     if ($this->partyEntityDescriptor) {
         $result->getPartyEntityContext()->setEntityDescriptor($this->partyEntityDescriptor);
     }
     if ($this->partyTrustOptions) {
         $result->getPartyEntityContext()->setTrustOptions($this->partyTrustOptions);
     }
     if ($this->endpoint) {
         $result->getEndpointContext()->setEndpoint($this->endpoint);
     }
     if ($this->message) {
         $result->getInboundContext()->setMessage($this->message);
     }
     if ($this->relayState) {
         $result->setRelayState($this->relayState);
     }
     return $result;
 }