Bump version to 5.0-14
[LibreOffice.git] / xmlsecurity / source / xmlsec / mscrypt / x509certificate_mscryptimpl.hxx
blobd1f10fb812da2078e3f7aad93d6ad555361df9f5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_XMLSECURITY_SOURCE_XMLSEC_MSCRYPT_X509CERTIFICATE_MSCRYPTIMPL_HXX
21 #define INCLUDED_XMLSECURITY_SOURCE_XMLSEC_MSCRYPT_X509CERTIFICATE_MSCRYPTIMPL_HXX
23 #ifdef _MSC_VER
24 #pragma warning(push,1)
25 #endif
26 #include "Windows.h"
27 #include "WinCrypt.h"
28 #ifdef _MSC_VER
29 #pragma warning(pop)
30 #endif
31 #include <sal/config.h>
32 #include <rtl/ustring.hxx>
33 #include <cppuhelper/factory.hxx>
34 #include <cppuhelper/implbase2.hxx>
35 #include <com/sun/star/uno/Exception.hpp>
36 #include <com/sun/star/lang/XUnoTunnel.hpp>
37 #include <com/sun/star/uno/SecurityException.hpp>
38 #include <com/sun/star/security/XCertificate.hpp>
40 class X509Certificate_MSCryptImpl : public ::cppu::WeakImplHelper2<
41 ::com::sun::star::security::XCertificate ,
42 ::com::sun::star::lang::XUnoTunnel >
44 private :
45 const CERT_CONTEXT* m_pCertContext ;
47 public :
48 X509Certificate_MSCryptImpl() ;
49 virtual ~X509Certificate_MSCryptImpl() ;
51 //Methods from XCertificate
52 virtual sal_Int16 SAL_CALL getVersion() throw ( ::com::sun::star::uno::RuntimeException) ;
54 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSerialNumber() throw ( ::com::sun::star::uno::RuntimeException) ;
55 virtual OUString SAL_CALL getIssuerName() throw ( ::com::sun::star::uno::RuntimeException) ;
56 virtual OUString SAL_CALL getSubjectName() throw ( ::com::sun::star::uno::RuntimeException) ;
57 virtual ::com::sun::star::util::DateTime SAL_CALL getNotValidBefore() throw ( ::com::sun::star::uno::RuntimeException) ;
58 virtual ::com::sun::star::util::DateTime SAL_CALL getNotValidAfter() throw ( ::com::sun::star::uno::RuntimeException) ;
59 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getIssuerUniqueID() throw ( ::com::sun::star::uno::RuntimeException) ;
60 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSubjectUniqueID() throw ( ::com::sun::star::uno::RuntimeException) ;
61 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > > SAL_CALL getExtensions() throw ( ::com::sun::star::uno::RuntimeException) ;
62 virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > SAL_CALL findCertificateExtension( const ::com::sun::star::uno::Sequence< sal_Int8 >& oid ) throw (::com::sun::star::uno::RuntimeException) ;
63 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getEncoded() throw ( ::com::sun::star::uno::RuntimeException) ;
64 virtual OUString SAL_CALL getSubjectPublicKeyAlgorithm()
65 throw ( ::com::sun::star::uno::RuntimeException) ;
66 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSubjectPublicKeyValue()
67 throw ( ::com::sun::star::uno::RuntimeException) ;
68 virtual OUString SAL_CALL getSignatureAlgorithm()
69 throw ( ::com::sun::star::uno::RuntimeException) ;
70 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSHA1Thumbprint()
71 throw ( ::com::sun::star::uno::RuntimeException) ;
72 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getMD5Thumbprint()
73 throw ( ::com::sun::star::uno::RuntimeException) ;
75 virtual sal_Int32 SAL_CALL getCertificateUsage( ) throw ( ::com::sun::star::uno::RuntimeException) ;
77 //Methods from XUnoTunnel
78 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (com::sun::star::uno::RuntimeException);
80 static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ;
81 static X509Certificate_MSCryptImpl* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rObj ) ;
83 //Helper methods
84 void setMswcryCert( const CERT_CONTEXT* cert ) ;
85 const CERT_CONTEXT* getMswcryCert() const ;
86 void setRawCert( ::com::sun::star::uno::Sequence< sal_Int8 > rawCert ) throw ( ::com::sun::star::uno::RuntimeException) ;
87 } ;
89 #endif // INCLUDED_XMLSECURITY_SOURCE_XMLSEC_MSCRYPT_X509CERTIFICATE_MSCRYPTIMPL_HXX
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */