keepassphp/lib/kphpdb.php
public function toKdbx(iKey $key, $filter, &$error)
	{
		$kdbx = KdbxFile::createForEncrypting(self::ROUNDS, $error);
		if($kdbx == null)
			return null;

		$this->_headerHash = $kdbx->getHeaderHash();

		$json = $this->toJSon($filter, $error);
		if(empty($json))
			return null;

		return $kdbx->encrypt($json, $key, $error);
	}
public function toKdbx(iKey $key, $filter, &$error)
	{
		$kdbx = KdbxFile::createForEncrypting(self::ROUNDS, $error);
		if($kdbx == null)
			return null;

		$this->_headerHash = $kdbx->getHeaderHash();

		$json = $this->toJSon($filter, $error);
		if(empty($json))
			return null;

		return $kdbx->encrypt($json, $key, $error);
	}
public function toKdbx ( iKey $ key , $ filter , & $ error ) { $ kdbx = KdbxFile :: createForEncrypting ( self :: ROUNDS , $ error ) ; if ( $ kdbx == null ) return null ; $ this -> _headerHash = $ kdbx -> getHeaderHash ( ) ; $ json = $ this -> toJSon ( $ filter , $ error ) ; if ( empty ( $ json ) ) return null ; return $ kdbx -> encrypt ( $ json , $ key , $ error ) ; }
Serializes this instance to a JSon string and encrypts it in a kdbx
file.
@param $key A iKey instance to use to encrypt the kdbx file.
@param $filter An iFilter instance to select the data of the database
that must actually be serialized (if null, it will
serialize everything except from passowrds).
@param &$error A string that will receive a message in case of error.
@return A string containing a kdbx file embbeding this serialized
instance, or null in case of error.
Serializes this instance to a JSon string and encrypts it in a kdbx file .