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/.
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 _X509CERTIFICATE_NSSIMPL_HXX_
21 #define _X509CERTIFICATE_NSSIMPL_HXX_
23 #include <sal/config.h>
24 #include <rtl/ustring.hxx>
25 #include <cppuhelper/factory.hxx>
26 #include <cppuhelper/implbase2.hxx>
27 #include <com/sun/star/uno/Exception.hpp>
28 #include <com/sun/star/lang/XUnoTunnel.hpp>
29 #include "com/sun/star/uno/SecurityException.hpp"
30 #include <com/sun/star/security/XCertificate.hpp>
34 class X509Certificate_NssImpl
: public ::cppu::WeakImplHelper2
<
35 ::com::sun::star::security::XCertificate
,
36 ::com::sun::star::lang::XUnoTunnel
>
39 CERTCertificate
* m_pCert
;
42 X509Certificate_NssImpl() ;
43 virtual ~X509Certificate_NssImpl() ;
45 //Methods from XCertificate
46 virtual sal_Int16 SAL_CALL
getVersion( ) throw ( ::com::sun::star::uno::RuntimeException
) ;
48 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getSerialNumber( ) throw ( ::com::sun::star::uno::RuntimeException
) ;
50 virtual OUString SAL_CALL
getIssuerName( ) throw ( ::com::sun::star::uno::RuntimeException
) ;
51 virtual OUString SAL_CALL
getSubjectName( ) throw ( ::com::sun::star::uno::RuntimeException
) ;
53 virtual ::com::sun::star::util::DateTime SAL_CALL
getNotValidBefore( ) throw ( ::com::sun::star::uno::RuntimeException
) ;
54 virtual ::com::sun::star::util::DateTime SAL_CALL
getNotValidAfter( ) throw ( ::com::sun::star::uno::RuntimeException
) ;
56 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getIssuerUniqueID( ) throw ( ::com::sun::star::uno::RuntimeException
) ;
57 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getSubjectUniqueID( ) throw ( ::com::sun::star::uno::RuntimeException
) ;
59 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
) ;
61 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
) ;
65 virtual OUString SAL_CALL
getSubjectPublicKeyAlgorithm()
66 throw ( ::com::sun::star::uno::RuntimeException
) ;
68 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getSubjectPublicKeyValue()
69 throw ( ::com::sun::star::uno::RuntimeException
) ;
71 virtual OUString SAL_CALL
getSignatureAlgorithm()
72 throw ( ::com::sun::star::uno::RuntimeException
) ;
74 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getSHA1Thumbprint()
75 throw ( ::com::sun::star::uno::RuntimeException
) ;
77 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getMD5Thumbprint()
78 throw ( ::com::sun::star::uno::RuntimeException
) ;
80 virtual sal_Int32 SAL_CALL
getCertificateUsage( ) throw ( ::com::sun::star::uno::RuntimeException
) ;
82 //Methods from XUnoTunnel
83 virtual sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& aIdentifier
) throw (com::sun::star::uno::RuntimeException
);
85 static const ::com::sun::star::uno::Sequence
< sal_Int8
>& getUnoTunnelId() ;
88 void setCert( CERTCertificate
* cert
) ;
89 const CERTCertificate
* getNssCert() const ;
90 void setRawCert( ::com::sun::star::uno::Sequence
< sal_Int8
> rawCert
) throw ( ::com::sun::star::uno::RuntimeException
) ;
93 #endif // _X509CERTIFICATE_NSSIMPL_HXX_
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */