Esempio n. 1
0
 public static function buildAssociate($server)
 {
     $args = array('openid.ns' => self::NAMESPACE, 'openid.mode' => 'associate', 'openid.assoc_type' => 'HMAC-SHA1');
     if (KeyManager::supportsDH()) {
         $args['openid.session_type'] = 'DH-SHA1';
         $args['openid.dh_modulus'] = KeyManager::getDhModulus();
         $args['openid.dh_gen'] = KeyManager::getDhGen();
         $args['openid.dh_consumer_public'] = KeyManager::getDhPublicKey($server);
     } else {
         $args['openid.session_type'] = '';
     }
     return self::addArguments(false, $args);
 }
Esempio n. 2
0
 public static function buildAssociate($server, $version = 1, $assocType = null, $sessionType = null)
 {
     if ($assocType == null) {
         $assocType = 'HMAC-SHA1';
     }
     if ($sessionType == null) {
         $sessionType = 'DH-SHA1';
     }
     $args = array('openid.mode' => 'associate', 'openid.assoc_type' => $assocType);
     if ($version >= self::MIN_VERSION_FOR_NS) {
         $args['openid.ns'] = self::$namespace[$version];
     }
     if (KeyManager::supportsDH()) {
         $args['openid.session_type'] = $sessionType;
         $args['openid.dh_modulus'] = KeyManager::getDhModulus();
         $args['openid.dh_gen'] = KeyManager::getDhGen();
         $args['openid.dh_consumer_public'] = KeyManager::getDhPublicKey($server);
     } else {
         $args['openid.session_type'] = '';
     }
     return self::addArguments(false, $args);
 }