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 
10 #ifndef INCLUDED_XMLSECURITY_INC_CERTIFICATE_H
11 #define INCLUDED_XMLSECURITY_INC_CERTIFICATE_H
12 
13 #include <sal/types.h>
14 
15 #include <com/sun/star/uno/Sequence.hxx>
16 
17 namespace svl
18 {
19 namespace crypto
20 {
21 enum class SignatureMethodAlgorithm;
22 }
23 }
24 
25 namespace xmlsecurity
26 {
27 
28 /// Extension of css::security::XCertificate for module-internal purposes.
29 class SAL_NO_VTABLE SAL_DLLPUBLIC_RTTI Certificate
30 {
31 public:
32 
33     /// Returns the SHA-256 thumbprint.
34     ///
35     /// @throws css::uno::RuntimeException
36     virtual css::uno::Sequence<sal_Int8> getSHA256Thumbprint() = 0;
37 
38     /// Same as getSubjectPublicKeyAlgorithm(), but returns an ID, not a string.
39     virtual svl::crypto::SignatureMethodAlgorithm getSignatureMethodAlgorithm() = 0;
40 
41 protected:
42     ~Certificate() noexcept = default;
43 };
44 
45 }
46 
47 #endif // INCLUDED_XMLSECURITY_INC_CERTIFICATE_H
48 
49 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
50