bump product version to 4.1.6.2
[LibreOffice.git] / xmlsecurity / source / xmlsec / certificateextension_xmlsecimpl.cxx
blob04736cbc57879624e39e0089387ddfd48c7727d8
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 #include <sal/config.h>
21 #include <rtl/uuid.h>
23 #ifndef _certificateextension_nssimpl_hxx_
24 #include "certificateextension_xmlsecimpl.hxx"
25 #endif
27 using namespace ::com::sun::star::uno ;
29 using ::com::sun::star::security::XCertificateExtension ;
31 CertificateExtension_XmlSecImpl :: CertificateExtension_XmlSecImpl() :
32 m_critical( sal_False ) ,
33 m_xExtnId() ,
34 m_xExtnValue()
38 CertificateExtension_XmlSecImpl :: ~CertificateExtension_XmlSecImpl() {
42 //Methods from XCertificateExtension
43 sal_Bool SAL_CALL CertificateExtension_XmlSecImpl :: isCritical() throw( ::com::sun::star::uno::RuntimeException ) {
44 return m_critical ;
47 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL CertificateExtension_XmlSecImpl :: getExtensionId() throw( ::com::sun::star::uno::RuntimeException ) {
48 return m_xExtnId ;
51 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL CertificateExtension_XmlSecImpl :: getExtensionValue() throw( ::com::sun::star::uno::RuntimeException ) {
52 return m_xExtnValue ;
55 void CertificateExtension_XmlSecImpl :: setCertExtn( unsigned char* value, unsigned int vlen, unsigned char* id, unsigned int idlen, sal_Bool critical ) {
56 unsigned int i ;
57 if( value != NULL && vlen != 0 ) {
58 Sequence< sal_Int8 > extnv( vlen ) ;
59 for( i = 0; i < vlen ; i ++ )
60 extnv[i] = *( value + i ) ;
62 m_xExtnValue = extnv ;
63 } else {
64 m_xExtnValue = Sequence<sal_Int8>();
67 if( id != NULL && idlen != 0 ) {
68 Sequence< sal_Int8 > extnId( idlen ) ;
69 for( i = 0; i < idlen ; i ++ )
70 extnId[i] = *( id + i ) ;
72 m_xExtnId = extnId ;
73 } else {
74 m_xExtnId = Sequence<sal_Int8>();
77 m_critical = critical ;
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */