1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
10 #ifndef INCLUDED_XMLSECURITY_SOURCE_GPG_X509CERTIFICATE_HXX
11 #define INCLUDED_XMLSECURITY_SOURCE_GPG_X509CERTIFICATE_HXX
13 #include <certificate.hxx>
15 #include <sal/types.h>
16 #include <sal/config.h>
17 #include <rtl/ustring.hxx>
18 #include <cppuhelper/factory.hxx>
19 #include <cppuhelper/implbase.hxx>
21 #include <com/sun/star/uno/Exception.hpp>
22 #include <com/sun/star/uno/RuntimeException.hpp>
23 #include <com/sun/star/uno/Sequence.hxx>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/lang/XUnoTunnel.hpp>
26 #include <com/sun/star/uno/SecurityException.hpp>
27 #include <com/sun/star/security/CertificateKind.hpp>
28 #include <com/sun/star/security/XCertificate.hpp>
32 class CertificateImpl
: public cppu::WeakImplHelper
< css::security::XCertificate
,
33 css::lang::XUnoTunnel
,
34 css::lang::XServiceInfo
>,
35 public xmlsecurity::Certificate
39 css::uno::Sequence
< sal_Int8
> m_aBits
;
43 virtual ~CertificateImpl() override
;
45 //Methods from XCertificate
46 virtual sal_Int16 SAL_CALL
getVersion() override
;
48 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getSerialNumber() override
;
50 virtual OUString SAL_CALL
getIssuerName() override
;
51 virtual OUString SAL_CALL
getSubjectName() override
;
53 virtual css::util::DateTime SAL_CALL
getNotValidBefore() override
;
54 virtual css::util::DateTime SAL_CALL
getNotValidAfter() override
;
56 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getIssuerUniqueID() override
;
57 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getSubjectUniqueID() override
;
59 virtual css::uno::Sequence
< css::uno::Reference
< css::security::XCertificateExtension
> > SAL_CALL
getExtensions() override
;
61 virtual css::uno::Reference
< css::security::XCertificateExtension
> SAL_CALL
findCertificateExtension(const css::uno::Sequence
< sal_Int8
>& oid
) override
;
63 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getEncoded() override
;
65 virtual OUString SAL_CALL
getSubjectPublicKeyAlgorithm() override
;
67 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getSubjectPublicKeyValue() override
;
69 virtual OUString SAL_CALL
getSignatureAlgorithm() override
;
71 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getSHA1Thumbprint() override
;
73 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getMD5Thumbprint() override
;
75 virtual sal_Int32 SAL_CALL
getCertificateUsage() override
;
77 //Methods from XUnoTunnel
78 virtual sal_Int64 SAL_CALL
getSomething(const css::uno::Sequence
< sal_Int8
>& aIdentifier
) override
;
80 static const css::uno::Sequence
< sal_Int8
>& getUnoTunnelId();
82 /// @see xmlsecurity::Certificate::getSHA256Thumbprint().
83 virtual css::uno::Sequence
<sal_Int8
> SAL_CALL
getSHA256Thumbprint() override
;
84 virtual css::security::CertificateKind SAL_CALL
getCertificateKind() override
;
87 void setCertificate(GpgME::Context
* ctx
, const GpgME::Key
& key
);
88 const GpgME::Key
* getCertificate() const;
91 virtual OUString SAL_CALL
getImplementationName() override
;
92 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
93 virtual css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
96 #endif // INCLUDED_XMLSECURITY_SOURCE_GPG_X509CERTIFICATE_HXX
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */