src/KeyStore.php
public function exists($user, $key)
    {
        if (!is_string($user)) {
            throw new \InvalidArgumentException();
        }

        if ($key instanceof \fpoirotte\Pssht\PublicKeyInterface) {
            $key = $this->getIdentifier($key);
        }
        if (!is_string($key)) {
            throw new \InvalidArgumentException();
        }

        return isset($this->keys[$user][$key]);
    }
public function exists($user, $key)
    {
        if (!is_string($user)) {
            throw new \InvalidArgumentException();
        }

        if ($key instanceof \fpoirotte\Pssht\PublicKeyInterface) {
            $key = $this->getIdentifier($key);
        }
        if (!is_string($key)) {
            throw new \InvalidArgumentException();
        }

        return isset($this->keys[$user][$key]);
    }
public function exists ( $ user , $ key ) { if ( ! is_string ( $ user ) ) { throw new \ InvalidArgumentException ( ) ; } if ( $ key instanceof \ fpoirotte \ Pssht \ PublicKeyInterface ) { $ key = $ this -> getIdentifier ( $ key ) ; } if ( ! is_string ( $ key ) ) { throw new \ InvalidArgumentException ( ) ; } return isset ( $ this -> keys [ $ user ] [ $ key ] ) ; }
Test whether a given key as been registered
for a specific user.

\param string $user
User for which the key is tested.

\param string|fpoirotte::Pssht::PublicKeyInterface $key
Key to test.

\retval bool
\c true if the given key has been registered
for the given user, \c false otherwise.
Test whether a given key as been registered for a specific user .