• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KIO

  • sources
  • kde-4.14
  • kdelibs
  • kio
  • kssl
ksslpemcallback.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  *
3  * Copyright (C) 2001 George Staikos <staikos@kde.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #include "ksslpemcallback.h"
22 
23 #include <config.h>
24 #include <ksslconfig.h>
25 
26 #include <kpassworddialog.h>
27 #include <klocale.h>
28 
29 int KSSLPemCallback(char *buf, int size, int rwflag, void *userdata) {
30 #ifdef KSSL_HAVE_SSL
31  Q_UNUSED(userdata);
32  Q_UNUSED(rwflag);
33 
34  if (!buf) return -1;
35 
36  KPasswordDialog dlg;
37  dlg.setPrompt(i18n("Certificate password"));
38  if( !dlg.exec() )
39  return -1;
40 
41  qstrncpy(buf, dlg.password().toLocal8Bit(), size-1);
42 
43  return (int)qstrlen(buf);
44 #else
45  Q_UNUSED(buf);
46  Q_UNUSED(size);
47  Q_UNUSED(rwflag);
48  Q_UNUSED(userdata);
49  return -1;
50 #endif
51 }
52 
53 
i18n
QString i18n(const char *text)
KSSLPemCallback
int KSSLPemCallback(char *buf, int size, int rwflag, void *userdata)
Definition: ksslpemcallback.cpp:29
QDialog::exec
int exec()
klocale.h
KPasswordDialog::password
QString password() const
QString::toLocal8Bit
QByteArray toLocal8Bit() const
KPasswordDialog
kpassworddialog.h
KPasswordDialog::setPrompt
void setPrompt(const QString &prompt)
ksslpemcallback.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal