20#ifndef INCLUDED_COMPHELPER_DOCPASSWORDHELPER_HXX
21#define INCLUDED_COMPHELPER_DOCPASSWORDHELPER_HXX
113 static css::uno::Sequence< css::beans::PropertyValue >
114 GenerateNewModifyPasswordInfo( std::u16string_view aPassword );
130 static css::uno::Sequence< css::beans::PropertyValue > ConvertPasswordInfo(
131 const css::uno::Sequence< css::beans::PropertyValue >& aInfo );
133 static css::uno::Sequence<css::beans::PropertyValue>
134 GenerateNewModifyPasswordInfoOOXML(std::u16string_view aPassword);
150 static bool IsModifyPasswordCorrect(
151 std::u16string_view aPassword,
152 const css::uno::Sequence< css::beans::PropertyValue >& aInfo );
165 static sal_uInt32 GetWordHashAsUINT32( std::u16string_view aString );
183 static sal_uInt16 GetXLHashAsUINT16(
184 std::u16string_view aString,
185 rtl_TextEncoding nEnc = RTL_TEXTENCODING_UTF8 );
199 static css::uno::Sequence< sal_Int8 > GetXLHashAsSequence(
200 std::u16string_view aString );
240 static css::uno::Sequence<sal_Int8> GetOoxHashAsSequence(
241 const OUString& rPassword,
242 std::u16string_view rSaltValue,
243 sal_uInt32 nSpinCount,
245 std::u16string_view rAlgorithmName);
286 static OUString GetOoxHashAsBase64(
287 const OUString& rPassword,
288 std::u16string_view rSaltValue,
289 sal_uInt32 nSpinCount,
291 std::u16string_view rAlgorithmName);
330 static std::vector<unsigned char> GetOoxHashAsVector(
331 const OUString& rPassword,
332 const std::vector<unsigned char>& rSaltValue,
333 sal_uInt32 nSpinCount,
335 std::u16string_view rAlgorithmName);
342 static css::uno::Sequence< sal_Int8 > GenerateRandomByteSequence(
351 std::u16string_view aPassword,
352 const css::uno::Sequence< sal_Int8 >& aDocId );
360 const sal_uInt16 pPassData[16],
361 const css::uno::Sequence< sal_Int8 >& aDocId );
367 static css::uno::Sequence< sal_Int8 > GenerateStd97Key(
368 const sal_uInt16 pPassData[16],
425 static css::uno::Sequence< css::beans::NamedValue > requestAndVerifyDocPassword(
427 const css::uno::Sequence< css::beans::NamedValue >& rMediaEncData,
428 const OUString& rMediaPassword,
429 const css::uno::Reference< css::task::XInteractionHandler >& rxInteractHandler,
430 const OUString& rDocumentUrl,
432 const ::std::vector< OUString >* pDefaultPasswords =
nullptr,
433 bool* pbIsDefaultPassword =
nullptr );
435 static css::uno::Sequence< css::beans::NamedValue > decryptGpgSession(
436 const css::uno::Sequence< css::uno::Sequence< css::beans::NamedValue > >& rGpgProperties);
Helper that asks for a document password and checks its validity.
static css::uno::Sequence< sal_Int8 > GenerateStd97Key(const sal_uInt16 pPassData[16], const css::uno::Sequence< sal_Int8 > &aDocId)
This helper function generates a byte sequence representing the key digest value used by MSCodec_Std9...
static css::uno::Sequence< sal_Int8 > GenerateStd97Key(std::u16string_view aPassword, const css::uno::Sequence< sal_Int8 > &aDocId)
This helper function generates a byte sequence representing the key digest value used by MSCodec_Std9...
Base class for a password verifier used by the DocPasswordHelper class below.
virtual DocPasswordVerifierResult verifyPassword(const OUString &rPassword, css::uno::Sequence< css::beans::NamedValue > &o_rEncryptionData)=0
Will be called every time a password needs to be verified.
virtual DocPasswordVerifierResult verifyEncryptionData(const css::uno::Sequence< css::beans::NamedValue > &o_rEncryptionData)=0
Will be called every time an encryption data needs to be verified.
#define COMPHELPER_DLLPUBLIC
DocPasswordRequestType
Selects which UNO document password request type to use.
DocPasswordVerifierResult