calculate encryption key

This commit is contained in:
Kulikova Svetlana
2022-03-21 17:32:45 +03:00
parent 4decd0c631
commit 02fa4142a7
7 changed files with 37 additions and 36 deletions

View File

@ -69,11 +69,6 @@ namespace PdfWriter
pObj = Get("P");
if (pObj && pObj->GetType() == object_type_NUMBER)
m_pEncrypt->SetPermission(((CNumberObject*)pObj)->Get());
pObj = Get("FileKey");
if (pObj && pObj->GetType() == object_type_BINARY)
m_pEncrypt->SetKey(((CBinaryObject*)pObj)->GetValue(), ((CBinaryObject*)pObj)->GetLength());
Remove("FileKey");
}
CEncryptDict::~CEncryptDict()
{
@ -201,4 +196,8 @@ namespace PdfWriter
CBinaryObject* pEncryptPerm = new CBinaryObject(m_pEncrypt->m_anPermEncrypt, 16);
Add("Perms", pEncryptPerm);
}
void CEncryptDict::UpdateKey()
{
m_pEncrypt->UpdateKey();
}
}