vpnengine/ikecert/inc/ikecert.h
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2007-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:   General utility methods for certificate handling
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef IKECERT_H
       
    22 #define IKECERT_H
       
    23 
       
    24 
       
    25 #include <e32base.h>
       
    26 
       
    27 class CX500DistinguishedName;
       
    28 class CX509Certificate;
       
    29 
       
    30 /**
       
    31  *  General utility methods for certificate handling
       
    32  *
       
    33  *  Contains static methods, which can be user to check thinks from 
       
    34  *  certificates.
       
    35  *
       
    36  *  @lib IkeCert.lib
       
    37  */
       
    38 class IkeCert
       
    39     {
       
    40 public:	
       
    41     IMPORT_C static HBufC8* GetCertificateFieldDERL(HBufC8* aCertBfr, TInt aField);
       
    42     IMPORT_C static HBufC8* GetCertificateFieldDERL(const CX509Certificate *aCert, TInt aField);
       
    43 	static TBool AltNameExistsL(const CX509Certificate *aX509Cert, const TDesC8 &aId);
       
    44 	IMPORT_C static HBufC8* GetSubjectAltNameDataL(const CX509Certificate *aX509Cert, TUint8 aIkeIdType);		
       
    45 	static HBufC8* BuildPkcs1v15HashL(const TDesC8 &aHashIn);
       
    46 	static void CleanupSequence(TAny* aArray);
       
    47 	static TInt CheckValidityPeriod(const CX509Certificate& aCert, TInt aWarningMargin, TInt aErrorMargin );		
       
    48 	static TInt VerifyCertExtensionsL(const CX509Certificate& aX509Cert);			
       
    49 
       
    50 private:		
       
    51 	static TUint8* BERGetLengthL(TUint8* aP, TInt &aLen);
       
    52     }; 
       
    53 
       
    54 
       
    55 #endif // IKECERT_H