Bump version to 5.0-14
[LibreOffice.git] / xmlsecurity / source / xmlsec / certificateextension_xmlsecimpl.cxx
blobaa16c5e2fbe02f0345ed022f7a733dc18805c849
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 #include "certificateextension_xmlsecimpl.hxx"
25 using namespace ::com::sun::star::uno ;
27 using ::com::sun::star::security::XCertificateExtension ;
29 CertificateExtension_XmlSecImpl :: CertificateExtension_XmlSecImpl() :
30 m_critical( false ) ,
31 m_xExtnId() ,
32 m_xExtnValue()
36 CertificateExtension_XmlSecImpl :: ~CertificateExtension_XmlSecImpl() {
40 //Methods from XCertificateExtension
41 sal_Bool SAL_CALL CertificateExtension_XmlSecImpl :: isCritical() throw( ::com::sun::star::uno::RuntimeException, std::exception ) {
42 return m_critical ;
45 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL CertificateExtension_XmlSecImpl :: getExtensionId() throw( ::com::sun::star::uno::RuntimeException, std::exception ) {
46 return m_xExtnId ;
49 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL CertificateExtension_XmlSecImpl :: getExtensionValue() throw( ::com::sun::star::uno::RuntimeException, std::exception ) {
50 return m_xExtnValue ;
53 void CertificateExtension_XmlSecImpl :: setCertExtn( unsigned char* value, unsigned int vlen, unsigned char* id, unsigned int idlen, bool critical ) {
54 unsigned int i ;
55 if( value != NULL && vlen != 0 ) {
56 Sequence< sal_Int8 > extnv( vlen ) ;
57 for( i = 0; i < vlen ; i ++ )
58 extnv[i] = *( value + i ) ;
60 m_xExtnValue = extnv ;
61 } else {
62 m_xExtnValue = Sequence<sal_Int8>();
65 if( id != NULL && idlen != 0 ) {
66 Sequence< sal_Int8 > extnId( idlen ) ;
67 for( i = 0; i < idlen ; i ++ )
68 extnId[i] = *( id + i ) ;
70 m_xExtnId = extnId ;
71 } else {
72 m_xExtnId = Sequence<sal_Int8>();
75 m_critical = critical ;
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */