equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtNetwork module of the Qt Toolkit. |
7 ** This file is part of the QtNetwork module of the Qt Toolkit. |
8 ** |
8 ** |
302 |
302 |
303 \sa subjectInfo() |
303 \sa subjectInfo() |
304 */ |
304 */ |
305 QString QSslCertificate::issuerInfo(SubjectInfo info) const |
305 QString QSslCertificate::issuerInfo(SubjectInfo info) const |
306 { |
306 { |
|
307 // lazy init |
307 if (d->issuerInfo.isEmpty() && d->x509) |
308 if (d->issuerInfo.isEmpty() && d->x509) |
308 d->issuerInfo = |
309 d->issuerInfo = |
309 _q_mapFromOnelineName(q_X509_NAME_oneline(q_X509_get_issuer_name(d->x509), 0, 0)); |
310 _q_mapFromOnelineName(q_X509_NAME_oneline(q_X509_get_issuer_name(d->x509), 0, 0)); |
310 |
311 |
311 return d->issuerInfo.value(_q_SubjectInfoToString(info)); |
312 return d->issuerInfo.value(_q_SubjectInfoToString(info)); |
318 |
319 |
319 \sa subjectInfo() |
320 \sa subjectInfo() |
320 */ |
321 */ |
321 QString QSslCertificate::issuerInfo(const QByteArray &tag) const |
322 QString QSslCertificate::issuerInfo(const QByteArray &tag) const |
322 { |
323 { |
323 // ### Use a QByteArray for the keys in the map |
324 // lazy init |
|
325 if (d->issuerInfo.isEmpty() && d->x509) |
|
326 d->issuerInfo = |
|
327 _q_mapFromOnelineName(q_X509_NAME_oneline(q_X509_get_issuer_name(d->x509), 0, 0)); |
|
328 |
324 return d->issuerInfo.value(QString::fromLatin1(tag)); |
329 return d->issuerInfo.value(QString::fromLatin1(tag)); |
325 } |
330 } |
326 |
331 |
327 /*! |
332 /*! |
328 |
333 |
333 |
338 |
334 \sa issuerInfo() |
339 \sa issuerInfo() |
335 */ |
340 */ |
336 QString QSslCertificate::subjectInfo(SubjectInfo info) const |
341 QString QSslCertificate::subjectInfo(SubjectInfo info) const |
337 { |
342 { |
|
343 // lazy init |
338 if (d->subjectInfo.isEmpty() && d->x509) |
344 if (d->subjectInfo.isEmpty() && d->x509) |
339 d->subjectInfo = |
345 d->subjectInfo = |
340 _q_mapFromOnelineName(q_X509_NAME_oneline(q_X509_get_subject_name(d->x509), 0, 0)); |
346 _q_mapFromOnelineName(q_X509_NAME_oneline(q_X509_get_subject_name(d->x509), 0, 0)); |
341 |
347 |
342 return d->subjectInfo.value(_q_SubjectInfoToString(info)); |
348 return d->subjectInfo.value(_q_SubjectInfoToString(info)); |
348 |
354 |
349 \sa issuerInfo() |
355 \sa issuerInfo() |
350 */ |
356 */ |
351 QString QSslCertificate::subjectInfo(const QByteArray &tag) const |
357 QString QSslCertificate::subjectInfo(const QByteArray &tag) const |
352 { |
358 { |
353 // ### Use a QByteArray for the keys in the map |
359 // lazy init |
|
360 if (d->subjectInfo.isEmpty() && d->x509) |
|
361 d->subjectInfo = |
|
362 _q_mapFromOnelineName(q_X509_NAME_oneline(q_X509_get_subject_name(d->x509), 0, 0)); |
|
363 |
354 return d->subjectInfo.value(QString::fromLatin1(tag)); |
364 return d->subjectInfo.value(QString::fromLatin1(tag)); |
355 } |
365 } |
356 |
366 |
357 /*! |
367 /*! |
358 Returns the list of alternative subject names for this |
368 Returns the list of alternative subject names for this |