~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to kde/src/lib/certificate.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2015-01-07 14:51:16 UTC
  • mfrom: (4.3.5 sid)
  • Revision ID: package-import@ubuntu.com-20150107145116-yxnafinf4lrdvrmx
Tags: 1.4.1-0.1ubuntu1
* Merge with Debian, remaining changes:
 - Drop soprano, nepomuk build-dep
* Drop ubuntu patches, now upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
 *   Copyright (C) 2014 by Savoir-Faire Linux                               *
 
3
 *   Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
 
4
 *                                                                          *
 
5
 *   This library is free software; you can redistribute it and/or          *
 
6
 *   modify it under the terms of the GNU Lesser General Public             *
 
7
 *   License as published by the Free Software Foundation; either           *
 
8
 *   version 2.1 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
 *   Lesser General Public License for more details.                        *
 
14
 *                                                                          *
 
15
 *   You should have received a copy of the GNU General Public License      *
 
16
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.  *
 
17
 ***************************************************************************/
 
18
#ifndef CERTIFICATE_H
 
19
#define CERTIFICATE_H
 
20
 
 
21
#include "typedefs.h"
 
22
 
 
23
//Qt
 
24
#include <QUrl>
 
25
 
 
26
class LIB_EXPORT Certificate : public QObject {
 
27
   Q_OBJECT
 
28
public:
 
29
 
 
30
   //Structures
 
31
   enum class Type {
 
32
      AUTHORITY  ,
 
33
      USER       ,
 
34
      PRIVATE_KEY,
 
35
      NONE       ,
 
36
   };
 
37
 
 
38
   explicit Certificate(Certificate::Type type ,const QObject* parent = nullptr);
 
39
 
 
40
   //Getter
 
41
   QUrl path() const;
 
42
   Certificate::Type type() const;
 
43
 
 
44
   //Setter
 
45
   void setPath(const QUrl& path);
 
46
 
 
47
   //Validation
 
48
   bool exist                    () const;
 
49
   bool isExpired                () const;
 
50
   bool isSelfSigned             () const;
 
51
   bool hasPrivateKey            () const;
 
52
   bool hasProtectedPrivateKey   () const;
 
53
   bool hasRightPermissions      () const;
 
54
   bool hasRightFolderPermissions() const;
 
55
   bool isLocationSecure         () const;
 
56
 
 
57
private:
 
58
   QUrl m_Path;
 
59
   Certificate::Type m_Type;
 
60
   //TODO
 
61
};
 
62
Q_DECLARE_METATYPE(Certificate*)
 
63
 
 
64
#endif