summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/component/documentdigitalsignatures.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmlsecurity/source/component/documentdigitalsignatures.cxx')
-rw-r--r--xmlsecurity/source/component/documentdigitalsignatures.cxx22
1 files changed, 9 insertions, 13 deletions
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index f69bbb4fece5..ac9f25ce41c9 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -653,12 +653,12 @@ sal_Bool DocumentDigitalSignatures::isAuthorTrusted(
{
OUString sSerialNum = xmlsecurity::bigIntegerToNumericString( Author->getSerialNumber() );
- Sequence< SvtSecurityOptions::Certificate > aTrustedAuthors = SvtSecurityOptions().GetTrustedAuthors();
+ std::vector< SvtSecurityOptions::Certificate > aTrustedAuthors = SvtSecurityOptions().GetTrustedAuthors();
return std::any_of(aTrustedAuthors.begin(), aTrustedAuthors.end(),
[&Author, &sSerialNum](const SvtSecurityOptions::Certificate& rAuthor) {
- return ( rAuthor[0] == Author->getIssuerName() )
- && ( rAuthor[1] == sSerialNum );
+ return ( rAuthor.SubjectName == Author->getIssuerName() )
+ && ( rAuthor.SerialNumber == sSerialNum );
});
}
@@ -762,20 +762,16 @@ void DocumentDigitalSignatures::addAuthorToTrustedSources(
{
SvtSecurityOptions aSecOpts;
- SvtSecurityOptions::Certificate aNewCert( 3 );
- aNewCert[ 0 ] = Author->getIssuerName();
- aNewCert[ 1 ] = xmlsecurity::bigIntegerToNumericString( Author->getSerialNumber() );
+ SvtSecurityOptions::Certificate aNewCert;
+ aNewCert.SubjectName = Author->getIssuerName();
+ aNewCert.SerialNumber = xmlsecurity::bigIntegerToNumericString( Author->getSerialNumber() );
OUStringBuffer aStrBuffer;
::comphelper::Base64::encode(aStrBuffer, Author->getEncoded());
- aNewCert[ 2 ] = aStrBuffer.makeStringAndClear();
-
-
- Sequence< SvtSecurityOptions::Certificate > aTrustedAuthors = aSecOpts.GetTrustedAuthors();
- sal_Int32 nCnt = aTrustedAuthors.getLength();
- aTrustedAuthors.realloc( nCnt + 1 );
- aTrustedAuthors[ nCnt ] = aNewCert;
+ aNewCert.RawData = aStrBuffer.makeStringAndClear();
+ std::vector< SvtSecurityOptions::Certificate > aTrustedAuthors = aSecOpts.GetTrustedAuthors();
+ aTrustedAuthors.push_back( aNewCert );
aSecOpts.SetTrustedAuthors( aTrustedAuthors );
}