Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #include <sal/config.h>
21 : #include <rtl/uuid.h>
22 :
23 : #ifndef _certificateextension_nssimpl_hxx_
24 : #include "certificateextension_xmlsecimpl.hxx"
25 : #endif
26 :
27 : using namespace ::com::sun::star::uno ;
28 :
29 : using ::com::sun::star::security::XCertificateExtension ;
30 :
31 0 : CertificateExtension_XmlSecImpl :: CertificateExtension_XmlSecImpl() :
32 : m_critical( sal_False ) ,
33 : m_xExtnId() ,
34 0 : m_xExtnValue()
35 : {
36 0 : }
37 :
38 0 : CertificateExtension_XmlSecImpl :: ~CertificateExtension_XmlSecImpl() {
39 0 : }
40 :
41 :
42 : //Methods from XCertificateExtension
43 0 : sal_Bool SAL_CALL CertificateExtension_XmlSecImpl :: isCritical() throw( ::com::sun::star::uno::RuntimeException, std::exception ) {
44 0 : return m_critical ;
45 : }
46 :
47 0 : ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL CertificateExtension_XmlSecImpl :: getExtensionId() throw( ::com::sun::star::uno::RuntimeException, std::exception ) {
48 0 : return m_xExtnId ;
49 : }
50 :
51 0 : ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL CertificateExtension_XmlSecImpl :: getExtensionValue() throw( ::com::sun::star::uno::RuntimeException, std::exception ) {
52 0 : return m_xExtnValue ;
53 : }
54 :
55 0 : void CertificateExtension_XmlSecImpl :: setCertExtn( unsigned char* value, unsigned int vlen, unsigned char* id, unsigned int idlen, sal_Bool critical ) {
56 : unsigned int i ;
57 0 : if( value != NULL && vlen != 0 ) {
58 0 : Sequence< sal_Int8 > extnv( vlen ) ;
59 0 : for( i = 0; i < vlen ; i ++ )
60 0 : extnv[i] = *( value + i ) ;
61 :
62 0 : m_xExtnValue = extnv ;
63 : } else {
64 0 : m_xExtnValue = Sequence<sal_Int8>();
65 : }
66 :
67 0 : if( id != NULL && idlen != 0 ) {
68 0 : Sequence< sal_Int8 > extnId( idlen ) ;
69 0 : for( i = 0; i < idlen ; i ++ )
70 0 : extnId[i] = *( id + i ) ;
71 :
72 0 : m_xExtnId = extnId ;
73 : } else {
74 0 : m_xExtnId = Sequence<sal_Int8>();
75 : }
76 :
77 0 : m_critical = critical ;
78 0 : }
79 :
80 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|