1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_xmlsecurity.hxx"
30 #include <sal/config.h>
33 #ifndef _certificateextension_nssimpl_hxx_
34 #include "certificateextension_xmlsecimpl.hxx"
37 using namespace ::com::sun::star::uno
;
38 using ::rtl::OUString
;
40 using ::com::sun::star::security::XCertificateExtension
;
42 CertificateExtension_XmlSecImpl :: CertificateExtension_XmlSecImpl() :
43 m_critical( sal_False
) ,
49 CertificateExtension_XmlSecImpl :: ~CertificateExtension_XmlSecImpl() {
53 //Methods from XCertificateExtension
54 sal_Bool SAL_CALL
CertificateExtension_XmlSecImpl :: isCritical() throw( ::com::sun::star::uno::RuntimeException
) {
58 ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
CertificateExtension_XmlSecImpl :: getExtensionId() throw( ::com::sun::star::uno::RuntimeException
) {
62 ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
CertificateExtension_XmlSecImpl :: getExtensionValue() throw( ::com::sun::star::uno::RuntimeException
) {
67 void CertificateExtension_XmlSecImpl :: setCertExtn( ::com::sun::star::uno::Sequence
< sal_Int8
> extnId
, ::com::sun::star::uno::Sequence
< sal_Int8
> extnValue
, sal_Bool critical
) {
68 m_critical
= critical
;
70 m_xExtnValue
= extnValue
;
73 void CertificateExtension_XmlSecImpl :: setCertExtn( unsigned char* value
, unsigned int vlen
, unsigned char* id
, unsigned int idlen
, sal_Bool critical
) {
75 if( value
!= NULL
&& vlen
!= 0 ) {
76 Sequence
< sal_Int8
> extnv( vlen
) ;
77 for( i
= 0; i
< vlen
; i
++ )
78 extnv
[i
] = *( value
+ i
) ;
80 m_xExtnValue
= extnv
;
82 m_xExtnValue
= Sequence
<sal_Int8
>();
85 if( id
!= NULL
&& idlen
!= 0 ) {
86 Sequence
< sal_Int8
> extnId( idlen
) ;
87 for( i
= 0; i
< idlen
; i
++ )
88 extnId
[i
] = *( id
+ i
) ;
92 m_xExtnId
= Sequence
<sal_Int8
>();
95 m_critical
= critical
;