xsecverify.cxx (06b3ce53) | xsecverify.cxx (716d67a2) |
---|---|
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 --- 163 unchanged lines hidden (view full) --- 172 } 173 174 cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector 175 (isi.xReferenceResolvedListener, cssu::UNO_QUERY); 176 xReferenceCollector->setReferenceCount( referenceCount ); 177 } 178} 179 | 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 --- 163 unchanged lines hidden (view full) --- 172 } 173 174 cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector 175 (isi.xReferenceResolvedListener, cssu::UNO_QUERY); 176 xReferenceCollector->setReferenceCount( referenceCount ); 177 } 178} 179 |
180void XSecController::setIfEmpty(rtl::OUString &variable, const rtl::OUString &value) { 181 if (variable.getLength() == 0) { 182 variable = value; 183 } else if (variable != value) { 184 throw cssu::RuntimeException(rtl::OUString::createFromAscii("Value already set. Tampering?"), *this); 185 } 186} 187 |
|
180void XSecController::setX509IssuerName( rtl::OUString& ouX509IssuerName ) 181{ 182 InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; | 188void XSecController::setX509IssuerName( rtl::OUString& ouX509IssuerName ) 189{ 190 InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; |
183 isi.signatureInfor.ouX509IssuerName = ouX509IssuerName; | 191 setIfEmpty(isi.signatureInfor.ouX509IssuerName, ouX509IssuerName); |
184} 185 186void XSecController::setX509SerialNumber( rtl::OUString& ouX509SerialNumber ) 187{ 188 InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; | 192} 193 194void XSecController::setX509SerialNumber( rtl::OUString& ouX509SerialNumber ) 195{ 196 InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; |
189 isi.signatureInfor.ouX509SerialNumber = ouX509SerialNumber; | 197 setIfEmpty(isi.signatureInfor.ouX509SerialNumber, ouX509SerialNumber); |
190} 191 192void XSecController::setX509Certificate( rtl::OUString& ouX509Certificate ) 193{ 194 InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; | 198} 199 200void XSecController::setX509Certificate( rtl::OUString& ouX509Certificate ) 201{ 202 InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; |
195 isi.signatureInfor.ouX509Certificate = ouX509Certificate; | 203 setIfEmpty(isi.signatureInfor.ouX509Certificate, ouX509Certificate); |
196} 197 198void XSecController::setSignatureValue( rtl::OUString& ouSignatureValue ) 199{ 200 InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; 201 isi.signatureInfor.ouSignatureValue = ouSignatureValue; 202} 203 204void XSecController::setDigestValue( rtl::OUString& ouDigestValue ) 205{ 206 SignatureInformation &si = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1].signatureInfor; 207 SignatureReferenceInformation &reference = si.vSignatureReferenceInfors[si.vSignatureReferenceInfors.size()-1]; 208 reference.ouDigestValue = ouDigestValue; 209} 210 211void XSecController::setDate( rtl::OUString& ouDate ) 212{ 213 InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; 214 convertDateTime( isi.signatureInfor.stDateTime, ouDate ); | 204} 205 206void XSecController::setSignatureValue( rtl::OUString& ouSignatureValue ) 207{ 208 InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; 209 isi.signatureInfor.ouSignatureValue = ouSignatureValue; 210} 211 212void XSecController::setDigestValue( rtl::OUString& ouDigestValue ) 213{ 214 SignatureInformation &si = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1].signatureInfor; 215 SignatureReferenceInformation &reference = si.vSignatureReferenceInfors[si.vSignatureReferenceInfors.size()-1]; 216 reference.ouDigestValue = ouDigestValue; 217} 218 219void XSecController::setDate( rtl::OUString& ouDate ) 220{ 221 InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; 222 convertDateTime( isi.signatureInfor.stDateTime, ouDate ); |
215 isi.signatureInfor.ouDateTime = ouDate; | 223 setIfEmpty(isi.signatureInfor.ouDateTime, ouDate); |
216} 217 218/* 219void XSecController::setTime( rtl::OUString& ouTime ) 220{ 221 InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; 222 isi.signatureInfor.ouTime = ouTime; 223} --- 104 unchanged lines hidden --- | 224} 225 226/* 227void XSecController::setTime( rtl::OUString& ouTime ) 228{ 229 InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; 230 isi.signatureInfor.ouTime = ouTime; 231} --- 104 unchanged lines hidden --- |