os/security/cryptoservices/certificateandkeymgmt/recog/CertRecog.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 1999-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 the License "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 * CApaCertificateRecognizer implementation
    16 *
    17 */
    18 
    19 
    20 /**
    21  @file 
    22  @internalTechnology
    23 */
    24  
    25 #if !defined(__RECTXT_H__)
    26 #define __RECTXT_H__
    27 
    28 #include <apmrec.h>
    29 
    30 
    31 
    32 /**
    33  * A recogniser that recognises the following MIME types:
    34  * application/vnd.wap.cert-response
    35  * application/x-x509-ca-cert
    36  * application/vnd.wap.wtls-ca-certificate
    37  */
    38 class CApaCertificateRecognizer : public CApaDataRecognizerType
    39 	{
    40 public:
    41 	CApaCertificateRecognizer();
    42 
    43 public: // from CApaDataRecognizerType
    44 	TUint PreferredBufSize();
    45 	TDataType SupportedDataTypeL( TInt aIndex ) const;
    46 
    47 	static CApaDataRecognizerType* CreateRecognizerL();
    48 
    49 private: // from CApaDataRecognizerType
    50 	void DoRecognizeL( const TDesC& aName, const TDesC8& aBuffer );
    51 
    52 private:
    53 	void DoRecognizeBufferL(const TDesC8& aBuffer, TBool aIsFile, RFile& aFile);
    54  	void RecognizeX509CertL( const TDesC8& aBuffer,  TBool aIsFile, RFile& aFile );
    55  	void RecognizeWTLSCertOrCertResponse( const TDesC8& aBuffer, TBool aIsFile, RFile& aFile);
    56  	void RecognizeWholeX509CertificateL(const TDesC8& aBuffer);
    57  	void ReadFileAndRecognizeL(RFile& aFileToRead);
    58 
    59 	};
    60 
    61 
    62 
    63 #endif