• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/kssl
 

tdeio/kssl

  • tdeio
  • kssl
ksslpemcallback.cpp
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 #ifdef HAVE_CONFIG_H
22 #include <config.h>
23 #endif
24 
25 #include <kpassdlg.h>
26 #include <tdelocale.h>
27 #include "ksslpemcallback.h"
28 
29 int KSSLPemCallback(char *buf, int size, int rwflag, void *userdata) {
30 #ifdef KSSL_HAVE_SSL
31  TQString pass2;
32  Q_UNUSED(userdata);
33  Q_UNUSED(rwflag);
34 
35  if (!buf) return -1;
36  int rc = KPasswordDialog::getPassword(pass2, i18n("Certificate password"));
37  if (rc != KPasswordDialog::Accepted) return -1;
38 
39  TQCString pass = pass2.utf8(); // utf8 length may differ from TQString length
40  const uint passlen = pass.length();
41  if (passlen > (unsigned int)size-1)
42  pass.truncate((unsigned int)size-1);
43 
44  tqstrncpy(buf, pass, size-1);
45  buf[size-1] = 0;
46  pass.fill(' ');
47  pass2.fill(' ');
48  return (int)passlen;
49 #else
50  Q_UNUSED(buf);
51  Q_UNUSED(size);
52  Q_UNUSED(rwflag);
53  Q_UNUSED(userdata);
54  return -1;
55 #endif
56 }
57 
58 

tdeio/kssl

Skip menu "tdeio/kssl"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeio/kssl

Skip menu "tdeio/kssl"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/kssl by doxygen 1.9.1
This website is maintained by Timothy Pearson.