Exemplo n.º 1
0
 /**
  * @param $type
  * @param $mac_function
  * @param $lifetime
  * @param $realm
  * @return IAssociation
  */
 private function buildAssociation($type, $mac_function, $lifetime, $realm)
 {
     $new_secret = OpenIdCryptoHelper::generateSecret($mac_function);
     $new_handle = AssocHandleGenerator::generate();
     $expires_in = intval($lifetime);
     $issued = gmdate("Y-m-d H:i:s", time());
     return new Association($new_handle, $new_secret, $mac_function, $expires_in, $issued, $type, $realm);
 }
Exemplo n.º 2
0
 public function testAssocHandlerGenerator()
 {
     $handler = AssocHandleGenerator::generate(32);
     $this->assertTrue(strlen($handler) == 32);
 }