LibreOffice Module filter (master) 1
|
#include <mscodec.hxx>
Public Member Functions | |
MSCodec_CryptoAPI () | |
virtual void | InitKey (const sal_uInt16 pPassData[16], const sal_uInt8 pDocId[16]) override |
Initializes the algorithm with the specified password and document ID. More... | |
virtual bool | InitCipher (sal_uInt32 nCounter) override |
Rekeys the codec using the specified counter. More... | |
virtual void | GetDigestFromSalt (const sal_uInt8 *pSaltData, sal_uInt8 *pDigest) override |
virtual css::uno::Sequence< css::beans::NamedValue > | GetEncryptionData () override |
Retrieves the encryption data. More... | |
Public Member Functions inherited from msfilter::MSCodec97 | |
MSCodec97 (size_t nHashLen, OUString aEncKeyName) | |
virtual | ~MSCodec97 () |
bool | InitCodec (const css::uno::Sequence< css::beans::NamedValue > &aData) |
Initializes the algorithm with the encryption data. More... | |
virtual css::uno::Sequence< css::beans::NamedValue > | GetEncryptionData () |
Retrieves the encryption data. More... | |
virtual void | InitKey (const sal_uInt16 pPassData[16], const sal_uInt8 pDocId[16])=0 |
Initializes the algorithm with the specified password and document ID. More... | |
bool | VerifyKey (const sal_uInt8 *pSaltData, const sal_uInt8 *pSaltDigest) |
Verifies the validity of the password using the passed salt data. More... | |
virtual void | GetDigestFromSalt (const sal_uInt8 *pSaltData, sal_uInt8 *pDigest)=0 |
virtual bool | InitCipher (sal_uInt32 nCounter)=0 |
Rekeys the codec using the specified counter. More... | |
bool | Encode (const void *pData, std::size_t nDatLen, sal_uInt8 *pBuffer, std::size_t nBufLen) |
Encodes a block of memory. More... | |
bool | Decode (const void *pData, std::size_t nDatLen, sal_uInt8 *pBuffer, std::size_t nBufLen) |
Decodes a block of memory. More... | |
bool | Skip (std::size_t nDatLen) |
Lets the cipher skip a specific amount of bytes. More... | |
void | GetDocId (sal_uInt8 pDocId[16]) |
Private Attributes | |
css::uno::Sequence< sal_Int8 > | m_aStd97Key |
Additional Inherited Members | |
Protected Attributes inherited from msfilter::MSCodec97 | |
OUString | m_sEncKeyName |
size_t | m_nHashLen |
rtlCipher | m_hCipher |
std::vector< sal_uInt8 > | m_aDocId |
std::vector< sal_uInt8 > | m_aDigestValue |
Definition at line 399 of file mscodec.hxx.
msfilter::MSCodec_CryptoAPI::MSCodec_CryptoAPI | ( | ) |
Definition at line 267 of file mscodec.cxx.
|
overridevirtual |
Implements msfilter::MSCodec97.
Definition at line 426 of file mscodec.cxx.
References comphelper::Hash::calculateHash(), and msfilter::MSCodec97::m_hCipher.
|
overridevirtual |
Retrieves the encryption data.
Reimplemented from msfilter::MSCodec97.
Definition at line 489 of file mscodec.cxx.
References comphelper::SequenceAsHashMap::getAsConstNamedValueList(), msfilter::MSCodec97::GetEncryptionData(), and m_aStd97Key.
|
overridevirtual |
Rekeys the codec using the specified counter.
After reading a specific amount of data the cipher algorithm needs to be rekeyed using a counter that counts the data blocks.
The block size is for example 512 Bytes for Word files and 1024 Bytes for Excel files.
@precond The codec must be initialized with InitKey() before this function can be used.
nCounter | Block counter used to rekey the cipher. |
Implements msfilter::MSCodec97.
Definition at line 470 of file mscodec.cxx.
References comphelper::Hash::calculateHash(), msfilter::ENCRYPT_KEY_SIZE_AES_128, msfilter::MSCodec97::m_aDigestValue, msfilter::MSCodec97::m_hCipher, and result.
|
overridevirtual |
Initializes the algorithm with the specified password and document ID.
pPassData | Wide character array containing the password. Must be zero terminated, which results in a maximum length of 15 characters. |
pDocId | Unique document identifier read from or written to the file. |
Implements msfilter::MSCodec97.
Definition at line 363 of file mscodec.cxx.
References comphelper::Hash::calculateHash(), comphelper::DocPasswordHelper::GenerateStd97Key(), msfilter::lcl_PrintDigest(), msfilter::MSCodec97::m_aDigestValue, msfilter::MSCodec97::m_aDocId, and m_aStd97Key.
|
private |
Definition at line 402 of file mscodec.hxx.
Referenced by GetEncryptionData(), and InitKey().