@param string $name

@return PrivateKeyEntry
@throws VirgilException
436493
public function load($name)
    {
        $keyEntry = $this->keyStorage->load($name);
        $privateKey = $this->privateKeyExporter->importPrivateKey($keyEntry->getValue());

        return new PrivateKeyEntry($privateKey, $keyEntry->getMeta());
    }
229108
public function store(KeyEntry $keyEntry)
    {
        $file = $this->buildFilePath($keyEntry->getName());

        $wroteBytes = file_put_contents($file, json_encode($keyEntry));

        if ($wroteBytes === false) {
            throw new VirgilException('Could not write key.');
        }

        return $this;
    }
392542
public function storeKey($name, $password)
    {
        if (strlen($name) === 0) {
            throw new SecurityException('Required name argument was empty', 1334215443);
        }
        if (strlen($password) === 0) {
            throw new SecurityException('Required password argument was empty', 1334215349);
        }
        $this->persistKey($name, $password);
    }
730453
public function createUserType($name)
    {
        $userType = new self();
        $userType->name = $name;
        if (!$userType->create()) {
            throw new UserTypeException($this->getMessages());
        }
        return $userType->id;
    }
1084753
public function findKey($name)
    {
        if (!(is_numeric($name) && $this->exist($name))) {
            $name = $this->search($name);
        }

        return $name;
    }
1043012
public static function inProperty(
        string $name,
        Deserializes $deserializer
    ): ExposesDataKey {
        return new self($name, $name, $deserializer);
    }
961381
public static function createDocument( $name )
    {
        // Check if a document with the given name exists.
        if ( !isset( self::$documents[$name] ) )
        {
            throw new phpillowNoSuchPropertyException( $name );
        }

        // Instantiate and return document.
        $className = self::$documents[$name];
        return call_user_func( array( $className, 'createNew' ) );
    }
526237
public static function init($name)
    {
        if (empty(self::$instance[$name]) || !self::$instance[$name] instanceof self) {
            self::$instance[$name]        = new self();
            self::$instance[$name]->queue = new \SplQueue();
        }
        return self::$instance[$name];
    }
323398
public function getRoom($name)
    {
        $name = rawurlencode($name);

        if (!isset($this->rooms[$name])) {
            $this->rooms[$name] = new Room($this->getConnection(), $name);
        }

        return $this->rooms[$name];
    }
1261400
public function importPrivateKey($exportedPrivateKey, $password = '')
    {
        try {
            $privateKeyDerEncoded = $this->cryptoService->decryptPrivateKey($exportedPrivateKey, $password);
            $receiverID = $this->calculateFingerprint(
                $this->cryptoService->extractPublicKey($privateKeyDerEncoded, '')
            );

            return new VirgilPrivateKey($receiverID, $privateKeyDerEncoded);
        } catch (Exception $exception) {
            throw new VirgilCryptoException($exception->getMessage());
        }
    }
158586
public function generateSignature($content, VirgilPrivateKey $signerPrivateKey)
    {
        try {
            return $this->cryptoService->sign($content, $signerPrivateKey->getValue());
        } catch (Exception $exception) {
            throw new VirgilCryptoException($exception->getMessage());
        }
    }
1273255
protected function resolveKey($name)
    {
        if (false !== $pos = strrpos($name, $this->namespaceCharacter)) {
            $name = substr($name, $pos + 1);
        }

        return $name;
    }
536411
public function action(string $name) : ActionDefiner
    {
        return new ActionDefiner($this->authSystem, $this->requiredPermissions, $name, function (IAction $action) {
            $this->actions[$action->getName()] = $action;
        });
    }
509494
final private function _getPortKey(&$name)
	{
		if (! is_string($name)) {
			throw new \InvalidArgumentException(sprintf(
				'%s requires a string. %s given instead',
				__METHOD__,
				gettype($name)
			));
		}
		$name = strtoupper(str_replace(['-', ':', '/'], ['_', null], $name));
	}
831543
public function getParametersWithKey($name)
    {
        $parameters = array();

        /** @var Parameter $parameter */
        foreach ($this->parameters as $parameter) {
            if ($parameter->getKey() == $name) {
                $parameters[] = $parameter;
            }
        }

        return $parameters;
    }
962387
protected function _invokeIsset($name)
    {
        if (!self::__isInvokable($name)) {
            return $this;
        }
        $is_static = self::__isStatic($name);
        $property = $this->findPropertyName($name);
        return !empty($property);
    }
985917
public function remove($name)
    {
        $this->checkLockAndValidateName($name);

        $normalized = $this->normalizeName($name);
        $has = $this->has($normalized);

        if ($has) {
            if (!$this->allowOverride) {
                throw new Exception\NotAllowedException();
            }

            unset($this->entries[$this->names[$normalized]]);
            unset($this->names[$normalized]);
        }

        return $this;
    }