|
1 /* |
|
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * A data object for CPKIMapper class thar holds the information |
|
16 * required to map API set to use the storage model which is not |
|
17 * native for that API. |
|
18 * |
|
19 */ |
|
20 |
|
21 #ifndef C_MAPDESCRIPTOR_H |
|
22 #define C_MAPDESCRIPTOR_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include "pkidefs.h" |
|
26 |
|
27 class TSecurityObjectDescriptor; |
|
28 class CX500DistinguishedName; |
|
29 class CX520AttributeTypeAndValue; |
|
30 |
|
31 /** |
|
32 * CMapDescriptor |
|
33 * |
|
34 * Maintains information of installed certificates and keys |
|
35 * |
|
36 * @lib internal (pkiservice.exe) |
|
37 * @since S60 v3.0 |
|
38 */ |
|
39 class CMapDescriptor : public CBase |
|
40 { |
|
41 public: |
|
42 enum TValidity |
|
43 { |
|
44 EValid, |
|
45 EExpired, |
|
46 ENotValidYet |
|
47 }; |
|
48 |
|
49 static CMapDescriptor* NewL(const TDesC& aLabel, |
|
50 const CX509Certificate& aCertificate, |
|
51 TPKICertificateOwnerType aOwnerType, |
|
52 TPkiServiceStoreType aCertStoreType); |
|
53 |
|
54 ~CMapDescriptor(); |
|
55 |
|
56 TBool IsMatchingL(TSecurityObjectDescriptor &aDesc, |
|
57 const TBool aInfoOnly, |
|
58 TPkiServiceStoreType aCertStoreType) const; |
|
59 TBool IsEqual(CMapDescriptor &aDesc); |
|
60 void SetMapDeletable(TBool aDeletable); |
|
61 void SetMapTrusted(const TBool &aTrusted); |
|
62 void SetMapApplications(const RArray<TUid> &aApplications); |
|
63 |
|
64 TPtrC Label() const; |
|
65 const TPKIKeyIdentifier& CertificateKeyId() const; |
|
66 TPKICertificateOwnerType OwnerType() const; |
|
67 TUint KeySize() const; |
|
68 TPtrC8 TrustedAuthority() const; |
|
69 TPtrC8 IdentitySubjectName() const; |
|
70 TPtrC8 SerialNumber() const; |
|
71 TPKIKeyAlgorithm KeyAlgorithm() const; |
|
72 TBool Deletable() const; |
|
73 |
|
74 TTime EndTime() const; |
|
75 |
|
76 TBool IsMatchingCertStore(const TDesC& aCertStoreName); |
|
77 TValidity CertValidity() const; |
|
78 |
|
79 TBool IsApplicable(TUid aApplUid) const; |
|
80 |
|
81 private: |
|
82 void ConstructL(const TDesC& aLabel, |
|
83 const CX509Certificate& aCertificate, |
|
84 TPKICertificateOwnerType aOwnerType, |
|
85 TPkiServiceStoreType aCertStoreType); |
|
86 |
|
87 TBool MatchL(const CX500DistinguishedName& aDn1, |
|
88 const CX500DistinguishedName& aDn2) const; |
|
89 |
|
90 |
|
91 TBool HasElementL(const CX500DistinguishedName& aDn, |
|
92 const CX520AttributeTypeAndValue& aElement) const; |
|
93 |
|
94 |
|
95 TBuf<SHORT_FILENAME_LENGTH> iLabel; |
|
96 TPkiServiceStoreType iCertStoreType; |
|
97 TPKICertificateOwnerType iOwnerType; |
|
98 |
|
99 HBufC8* iIssuerName; |
|
100 HBufC8* iSubjectName; |
|
101 HBufC8* iRfc822Name; |
|
102 HBufC8* iSerialNumber; |
|
103 |
|
104 TPKIKeyIdentifier iKeyId; |
|
105 |
|
106 TUint iKeySize; |
|
107 TPKIKeyAlgorithm iKeyAlgorithm; |
|
108 TTime iStartTime; |
|
109 TTime iEndTime; |
|
110 |
|
111 TBool iIsDeletable; |
|
112 TBool iIsTrusted; |
|
113 RArray<TUid> iApplUids; |
|
114 }; |
|
115 |
|
116 |
|
117 #endif //C_MAPDESCRIPTOR_H |