LibreOffice Module svl (master) 1
PasswordHelper.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_SVL_PASSWORDHELPER_HXX
21#define INCLUDED_SVL_PASSWORDHELPER_HXX
22
23#include <sal/config.h>
24
25#include <string_view>
26
27#include <svl/svldllapi.h>
28#include <sal/types.h>
29#include <com/sun/star/uno/Sequence.hxx>
30
32{
33 static void GetHashPasswordLittleEndian(css::uno::Sequence<sal_Int8>& rPassHash, std::u16string_view sPass);
34 static void GetHashPasswordBigEndian(css::uno::Sequence<sal_Int8>& rPassHash, std::u16string_view sPass);
35
36public:
37 SVL_DLLPUBLIC static void GetHashPassword(css::uno::Sequence <sal_Int8>& rPassHash, const char* pPass, sal_uInt32 nLen);
38
39 SVL_DLLPUBLIC static void GetHashPassword(css::uno::Sequence<sal_Int8>& rPassHash, std::u16string_view sPass);
40 SVL_DLLPUBLIC static void GetHashPasswordSHA1UTF8(css::uno::Sequence<sal_Int8>& rPassHash, std::u16string_view sPass);
41 SVL_DLLPUBLIC static void GetHashPasswordSHA256(css::uno::Sequence<sal_Int8>& rPassHash, std::u16string_view sPass);
50 SVL_DLLPUBLIC static bool CompareHashPassword(const css::uno::Sequence<sal_Int8>& rOldPassHash, std::u16string_view sNewPass);
51};
52
53#endif
54
55/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static void GetHashPasswordBigEndian(css::uno::Sequence< sal_Int8 > &rPassHash, std::u16string_view sPass)
static SVL_DLLPUBLIC void GetHashPassword(css::uno::Sequence< sal_Int8 > &rPassHash, const char *pPass, sal_uInt32 nLen)
static SVL_DLLPUBLIC void GetHashPassword(css::uno::Sequence< sal_Int8 > &rPassHash, std::u16string_view sPass)
static SVL_DLLPUBLIC void GetHashPasswordSHA1UTF8(css::uno::Sequence< sal_Int8 > &rPassHash, std::u16string_view sPass)
static SVL_DLLPUBLIC bool CompareHashPassword(const css::uno::Sequence< sal_Int8 > &rOldPassHash, std::u16string_view sNewPass)
Use this method to compare a given string with another given Hash value.
static SVL_DLLPUBLIC void GetHashPasswordSHA256(css::uno::Sequence< sal_Int8 > &rPassHash, std::u16string_view sPass)
static void GetHashPasswordLittleEndian(css::uno::Sequence< sal_Int8 > &rPassHash, std::u16string_view sPass)
#define SVL_DLLPUBLIC
Definition: svldllapi.h:28