epoc32/include/mctwritablecertstore.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     5
* under the terms of the License "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description: 
williamr@2
    15
* MCTWritableCertStore.h (v.2)
williamr@2
    16
*
williamr@2
    17
*/
williamr@2
    18
williamr@2
    19
williamr@2
    20
williamr@2
    21
williamr@2
    22
/**
williamr@2
    23
 @file 
williamr@2
    24
 @publishedPartner
williamr@2
    25
 @released
williamr@2
    26
*/
williamr@2
    27
 
williamr@2
    28
#ifndef __MCTWRITABLECERTSTORE_H__
williamr@2
    29
#define __MCTWRITABLECERTSTORE_H__
williamr@2
    30
williamr@2
    31
#include <mctcertstore.h>
williamr@2
    32
williamr@2
    33
/**
williamr@2
    34
 * The UID of writeable certificate store interfaces.
williamr@2
    35
 *
williamr@2
    36
 * A token that supports this interface should also support the read-only certificate 
williamr@2
    37
 * store interface.
williamr@2
    38
 */
williamr@2
    39
const TInt KInterfaceWritableCertStore = 0x102020FB; // new version, since 9.0
williamr@2
    40
williamr@2
    41
/**
williamr@2
    42
 * Defines the interface for a writeable certificate store token.
williamr@2
    43
 * 
williamr@2
    44
 * This extends the read-only certificate store API in MCTCertStore by adding 
williamr@2
    45
 * functions to add and delete certificates, and to set their applicability and 
williamr@2
    46
 * trust settings. 
williamr@2
    47
 *
williamr@2
    48
 * This documentation describes the security policy that must be enforced by
williamr@2
    49
 * implementations of the interface.
williamr@2
    50
 * 
williamr@2
    51
 * @publishedPartner
williamr@2
    52
 * @released
williamr@2
    53
 */
williamr@2
    54
class MCTWritableCertStore : public MCTCertStore
williamr@2
    55
	{
williamr@2
    56
public:
williamr@2
    57
	/**
williamr@2
    58
	 * Adding a certificate
williamr@2
    59
	 */
williamr@2
    60
williamr@2
    61
	/**
williamr@2
    62
	 * Adds a certificate to the store.
williamr@2
    63
	 * 
williamr@2
    64
	 * This is an asynchronous request.	
williamr@2
    65
	 * 
williamr@2
    66
	 * @param aLabel				The label of the certificate to add.
williamr@2
    67
	 * @param aFormat				The format of the certificate.
williamr@2
    68
	 * @param aCertificateOwnerType	The owner type.
williamr@2
    69
	 * @param aSubjectKeyId			The Subject key ID.
williamr@2
    70
	 * @param aIssuerKeyId			The issuer key ID.
williamr@2
    71
	 * @param aCert					The certificate to be added.
williamr@2
    72
	 * @param aStatus				The request status object; contains the result of the Add() 
williamr@2
    73
	 * 								request when complete. Set to KErrCancel, if an outstanding 
williamr@2
    74
	 * 								request is cancelled.
williamr@2
    75
	 *
williamr@2
    76
	 * @capability WriteUserData	This requires the WriteUserData capability when
williamr@2
    77
	 *								applied to user certificates.
williamr@2
    78
	 * @capability WriteDeviceData	This requires the WriteDeviceData capability
williamr@2
    79
	 *								when applied to CA certificates.
williamr@2
    80
	 * @leave KErrPermissionDenied	If the caller doesn't have the required capabilities.
williamr@2
    81
	 */
williamr@2
    82
	virtual void Add(const TDesC& aLabel, TCertificateFormat aFormat,
williamr@2
    83
					 TCertificateOwnerType aCertificateOwnerType, 
williamr@2
    84
					 const TKeyIdentifier* aSubjectKeyId,
williamr@2
    85
					 const TKeyIdentifier* aIssuerKeyId,
williamr@2
    86
					 const TDesC8& aCert, TRequestStatus& aStatus) = 0;
williamr@2
    87
		
williamr@2
    88
	/** Cancels an ongoing Add() operation. */
williamr@2
    89
	virtual void CancelAdd() = 0;
williamr@2
    90
williamr@2
    91
	/**
williamr@2
    92
	 * Removing Certificates
williamr@2
    93
	 */
williamr@2
    94
	
williamr@2
    95
	/**
williamr@2
    96
	 * Removes a certificate.
williamr@2
    97
	 * 
williamr@2
    98
	 * @param aCertInfo	The certificate to be removed.
williamr@2
    99
	 * @param aStatus	The request status object; contains the result of the Remove() 
williamr@2
   100
	 * 					request when complete. Set to KErrCancel, if an outstanding request is cancelled.
williamr@2
   101
	 *
williamr@2
   102
	 * @capability WriteUserData	This requires the WriteUserData capability when
williamr@2
   103
	 *								applied to user certificates.
williamr@2
   104
	 * @capability WriteDeviceData	This requires the WriteDeviceData capability
williamr@2
   105
	 *								when applied to CA certificates.
williamr@2
   106
	 * @leave KErrPermissionDenied	If the caller doesn't have the required capabilities.
williamr@2
   107
	 */
williamr@2
   108
	virtual void Remove(const CCTCertInfo& aCertInfo, TRequestStatus& aStatus) = 0;
williamr@2
   109
williamr@2
   110
	/** Cancels an ongoing Remove() operation. */
williamr@2
   111
	virtual void CancelRemove() = 0;
williamr@2
   112
williamr@2
   113
	/**
williamr@2
   114
	 * Setting applicability
williamr@2
   115
	 */
williamr@2
   116
		
williamr@2
   117
	/**
williamr@2
   118
	 * Replaces the current applicability settings with the settings in the
williamr@2
   119
	 * supplied array.
williamr@2
   120
	 * 
williamr@2
   121
	 * This should only be called for CA certificates - it has no meaning for
williamr@2
   122
	 * user certificates.
williamr@2
   123
	 * 
williamr@2
   124
	 * If this function is called by the unified certstore the given application
williamr@2
   125
	 * uids array is guaranteed not to contain duplicates. However, client
williamr@2
   126
	 * applications may bypass the unified certstore and call this function
williamr@2
   127
	 * directly, in that case the array passed might contain duplicates.
williamr@2
   128
	 * 
williamr@2
   129
	 * @param aCertInfo		The certificate whose applicability should be updated.
williamr@2
   130
	 * @param aApplications	The new applicability settings. Ownership of this
williamr@2
   131
	 * 						remains with the caller, and it must remain valid for the
williamr@2
   132
	 * 						lifetime of the call.
williamr@2
   133
	 * @param aStatus		The request status object; contains the result of the SetApplicability() 
williamr@2
   134
	 * 						request when complete. Set to KErrCancel, if an outstanding request is cancelled.
williamr@2
   135
	 *
williamr@2
   136
	 * @capability WriteDeviceData	This requires the WriteDeviceData capability.
williamr@2
   137
	 * @leave KErrPermissionDenied	If the caller doesn't have the required capabilities.
williamr@2
   138
	 */
williamr@2
   139
	virtual void SetApplicability(const CCTCertInfo& aCertInfo, 
williamr@2
   140
						  const RArray<TUid>& aApplications, TRequestStatus &aStatus) = 0;
williamr@2
   141
williamr@2
   142
	/** Cancels an ongoing SetApplicability() operation. */
williamr@2
   143
	virtual void CancelSetApplicability() = 0;
williamr@2
   144
williamr@2
   145
	/**
williamr@2
   146
	 * Changing trust settings
williamr@2
   147
	 */
williamr@2
   148
williamr@2
   149
	/**
williamr@2
   150
	 * Changes the trust settings.
williamr@2
   151
	 * 
williamr@2
   152
	 * A CA certificate is trusted if the user is willing to use it for authenticating 
williamr@2
   153
	 * servers. It has no meaning with other types of certificates.
williamr@2
   154
	 * 
williamr@2
   155
	 * @param aCertInfo	The certificate to be updated.
williamr@2
   156
	 * @param aTrusted	ETrue, if trusted; EFalse, otherwise.
williamr@2
   157
	 * @param aStatus	The request status object; contains the result of the SetTrust() 
williamr@2
   158
	 * 					request when complete. Set to KErrCancel, if an outstanding request is cancelled.
williamr@2
   159
	 *
williamr@2
   160
	 * @capability WriteDeviceData	This requires the WriteDeviceData capability.
williamr@2
   161
	 * @leave KErrPermissionDenied	If the caller doesn't have the required capabilities.
williamr@2
   162
	 */
williamr@2
   163
	virtual void SetTrust(const CCTCertInfo& aCertInfo, TBool aTrusted, 
williamr@2
   164
						  TRequestStatus& aStatus) = 0;
williamr@2
   165
williamr@2
   166
	/** Cancels an ongoing SetTrust() operation. */
williamr@2
   167
	virtual void CancelSetTrust() = 0;
williamr@2
   168
			
williamr@2
   169
	/**
williamr@2
   170
	 * Adding a certificate
williamr@2
   171
	 */
williamr@2
   172
	
williamr@2
   173
	/**
williamr@2
   174
	 * Same as original Add() method above, but with additional parameter TBool aDeletable.
williamr@2
   175
	 *
williamr@2
   176
	 * @param aLabel				The label of the certificate to add.
williamr@2
   177
	 * @param aFormat				The format of the certificate.
williamr@2
   178
	 * @param aCertificateOwnerType	The owner type.
williamr@2
   179
	 * @param aSubjectKeyId			The Subject key ID.
williamr@2
   180
	 * @param aIssuerKeyId			The issuer key ID.
williamr@2
   181
	 * @param aCert					The certificate to be added.
williamr@2
   182
	 * 
williamr@2
   183
	 * @param aDeletable			Sets the value for the certificate's deletable flag
williamr@2
   184
	 * 									= true 	- means it is permitted to remove the
williamr@2
   185
	 *												certificate from certstore
williamr@2
   186
	 * 									= false - means the certificate is NOT deletable.
williamr@2
   187
	 *
williamr@2
   188
	 * @param aStatus				The request status object;
williamr@2
   189
	 * 								contains the result of the Add() request when complete. 
williamr@2
   190
	 *								Two of possible error values:
williamr@2
   191
	 *									= KErrCancel, if an outstanding request is cancelled;
williamr@2
   192
	 *									= KErrNotSupported (-5), if the method is called from a
williamr@2
   193
	 *										child class that doesn't support implementation of
williamr@2
   194
	 *										the new Add() method.
williamr@2
   195
	 *
williamr@2
   196
	 * @capability WriteUserData	This requires the WriteUserData capability when
williamr@2
   197
	 *								applied to user certificates.
williamr@2
   198
	 * @capability WriteDeviceData	This requires the WriteDeviceData capability
williamr@2
   199
	 *								when applied to CA certificates.
williamr@2
   200
	 * @leave KErrPermissionDenied	If the caller doesn't have the required capabilities.
williamr@2
   201
	 */
williamr@2
   202
	virtual void Add(const TDesC& aLabel, TCertificateFormat aFormat,
williamr@2
   203
					 TCertificateOwnerType aCertificateOwnerType, 
williamr@2
   204
					 const TKeyIdentifier* aSubjectKeyId,
williamr@2
   205
					 const TKeyIdentifier* aIssuerKeyId,
williamr@2
   206
					 const TDesC8& aCert, 
williamr@2
   207
					 const TBool aDeletable,
williamr@2
   208
					 TRequestStatus& aStatus );
williamr@2
   209
	
williamr@2
   210
	};
williamr@2
   211
williamr@2
   212
williamr@2
   213
#include "mctwritablecertstore.inl"
williamr@2
   214
williamr@2
   215
#endif