1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _CERTIFICATEEXTENSION_XMLSECIMPL_HXX_ 25 #define _CERTIFICATEEXTENSION_XMLSECIMPL_HXX_ 26 27 #include <sal/config.h> 28 #include <rtl/ustring.hxx> 29 #include <cppuhelper/factory.hxx> 30 #include <cppuhelper/implbase1.hxx> 31 #include <com/sun/star/uno/Exception.hpp> 32 #include "com/sun/star/uno/SecurityException.hpp" 33 #include <com/sun/star/security/XCertificateExtension.hpp> 34 35 class CertificateExtension_XmlSecImpl : public ::cppu::WeakImplHelper1< 36 ::com::sun::star::security::XCertificateExtension > 37 { 38 private : 39 sal_Bool m_critical ; 40 ::com::sun::star::uno::Sequence< sal_Int8 > m_xExtnId ; 41 ::com::sun::star::uno::Sequence< sal_Int8 > m_xExtnValue ; 42 43 public : 44 CertificateExtension_XmlSecImpl() ; 45 virtual ~CertificateExtension_XmlSecImpl() ; 46 47 //Methods from XCertificateExtension 48 virtual sal_Bool SAL_CALL isCritical() throw( ::com::sun::star::uno::RuntimeException ) ; 49 50 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getExtensionId() throw( ::com::sun::star::uno::RuntimeException ) ; 51 52 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getExtensionValue() throw( ::com::sun::star::uno::RuntimeException ) ; 53 54 //Helper method 55 void setCertExtn( ::com::sun::star::uno::Sequence< sal_Int8 > extnId, ::com::sun::star::uno::Sequence< sal_Int8 > extnValue, sal_Bool critical ) ; 56 57 void setCertExtn( unsigned char* value, unsigned int vlen, unsigned char* id, unsigned int idlen, sal_Bool critical ) ; 58 } ; 59 60 #endif // _CERTIFICATEEXTENSION_XMLSECIMPL_HXX_ 61 62