fixed issue loading kdb files with key file

improved error message by adding messages to loading exceptions in Java
This commit is contained in:
Philipp Crocoll
2014-11-11 17:19:22 +01:00
parent 3239131a84
commit 49c4fa5b05
13 changed files with 79 additions and 15 deletions

View File

@@ -43,6 +43,7 @@ namespace KeePassLib.Keys
{
private IOConnectionInfo m_ioc;
private ProtectedBinary m_pbKeyData;
private ProtectedBinary m_pbFileData;
/// <summary>
/// Path to the key file.
@@ -67,6 +68,11 @@ namespace KeePassLib.Keys
get { return m_ioc; }
}
public ProtectedBinary RawFileData
{
get { return m_pbFileData; }
}
public KcpKeyFile(string strKeyFile)
{
Construct(IOConnectionInfo.FromPath(strKeyFile), false);
@@ -95,6 +101,7 @@ namespace KeePassLib.Keys
private void Construct(byte[] pbFileData, IOConnectionInfo iocKeyFile, bool bThrowIfDbFile)
{
if (pbFileData == null) throw new Java.IO.FileNotFoundException();
m_pbFileData = new ProtectedBinary(true, pbFileData);
if (bThrowIfDbFile && (pbFileData.Length >= 8))
{