merged tag ooo/OOO330_m14
[LibreOffice.git] / xmlsecurity / source / xmlsec / nss / x509certificate_nssimpl.hxx
blobc486cb4a9e8c575bc4a315f5f3634a8695da44bd
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef _X509CERTIFICATE_NSSIMPL_HXX_
29 #define _X509CERTIFICATE_NSSIMPL_HXX_
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 #include "cert.h"
42 class X509Certificate_NssImpl : public ::cppu::WeakImplHelper2<
43 ::com::sun::star::security::XCertificate ,
44 ::com::sun::star::lang::XUnoTunnel >
46 private :
47 CERTCertificate* m_pCert ;
49 public :
50 X509Certificate_NssImpl() ;
51 virtual ~X509Certificate_NssImpl() ;
53 //Methods from XCertificate
54 virtual sal_Int16 SAL_CALL getVersion( ) throw ( ::com::sun::star::uno::RuntimeException) ;
56 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSerialNumber( ) throw ( ::com::sun::star::uno::RuntimeException) ;
58 virtual ::rtl::OUString SAL_CALL getIssuerName( ) throw ( ::com::sun::star::uno::RuntimeException) ;
60 virtual ::rtl::OUString SAL_CALL getSubjectName( ) throw ( ::com::sun::star::uno::RuntimeException) ;
62 virtual ::com::sun::star::util::DateTime SAL_CALL getNotValidBefore( ) throw ( ::com::sun::star::uno::RuntimeException) ;
64 virtual ::com::sun::star::util::DateTime SAL_CALL getNotValidAfter( ) throw ( ::com::sun::star::uno::RuntimeException) ;
66 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getIssuerUniqueID( ) throw ( ::com::sun::star::uno::RuntimeException) ;
68 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSubjectUniqueID( ) throw ( ::com::sun::star::uno::RuntimeException) ;
70 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) ;
72 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) ;
74 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getEncoded( ) throw ( ::com::sun::star::uno::RuntimeException) ;
76 // MM : added by MM
77 virtual ::rtl::OUString SAL_CALL getSubjectPublicKeyAlgorithm()
78 throw ( ::com::sun::star::uno::RuntimeException) ;
80 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSubjectPublicKeyValue()
81 throw ( ::com::sun::star::uno::RuntimeException) ;
83 virtual ::rtl::OUString SAL_CALL getSignatureAlgorithm()
84 throw ( ::com::sun::star::uno::RuntimeException) ;
86 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSHA1Thumbprint()
87 throw ( ::com::sun::star::uno::RuntimeException) ;
89 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getMD5Thumbprint()
90 throw ( ::com::sun::star::uno::RuntimeException) ;
92 virtual sal_Int32 SAL_CALL getCertificateUsage( ) throw ( ::com::sun::star::uno::RuntimeException) ;
93 // MM : end
95 //Methods from XUnoTunnel
96 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (com::sun::star::uno::RuntimeException);
98 static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ;
99 static X509Certificate_NssImpl* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xObj ) ;
101 //Helper methods
102 void setCert( CERTCertificate* cert ) ;
103 const CERTCertificate* getNssCert() const ;
104 void setRawCert( ::com::sun::star::uno::Sequence< sal_Int8 > rawCert ) throw ( ::com::sun::star::uno::RuntimeException) ;
107 #endif // _X509CERTIFICATE_NSSIMPL_HXX_