cryptoservices/certificateandkeymgmt/tcertcommon/tcertwriter.h
changeset 0 2c201484c85f
child 8 35751d3474b7
equal deleted inserted replaced
-1:000000000000 0:2c201484c85f
       
     1 /*
       
     2 * Copyright (c) 1998-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 * CertWriter class implementation
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @file 
       
    24  @internalTechnology
       
    25 */
       
    26  
       
    27 #ifndef __TCERTWRITER_H__
       
    28 #define __TCERTWRITER_H__
       
    29 
       
    30 #include "t_output.h"
       
    31 #include <x509cert.h>
       
    32 #include <x509gn.h>
       
    33 #include <x509certext.h>
       
    34 
       
    35 class CertWriter
       
    36 	{
       
    37 public:
       
    38 	IMPORT_C CertWriter(Output* aOut);
       
    39 	IMPORT_C void SetOut(Output* aOut);
       
    40 	IMPORT_C void WriteCert(const CX509Certificate& aCertificate);
       
    41 	IMPORT_C void ShowSigningAlgorithm(const CSigningAlgorithmIdentifier& aSigningAlgorithm);
       
    42 	IMPORT_C void ShowPublicKey(const CX509Certificate& aCertificate);
       
    43 	IMPORT_C void ShowSerialNumber(const TPtrC8& aSerialNumber);
       
    44 	IMPORT_C void ShowAVA(const CX520AttributeTypeAndValue& aAva);
       
    45 	IMPORT_C void ShowDN(const CX500DistinguishedName& aName);
       
    46 	IMPORT_C void ShowAKI(const CX509Certificate& aCert);
       
    47 	IMPORT_C void ShowSKI(const CX509Certificate& aCert);
       
    48 	IMPORT_C void ShowGN(const CX509GeneralName& aName);
       
    49 	IMPORT_C void ShowFingerprint(const CX509Certificate& aCertificate);
       
    50 	IMPORT_C void ShowExtensions(const CX509Certificate& aCertificate);
       
    51 	IMPORT_C void ShowValidityPeriod(const CX509Certificate& aCertificate);
       
    52 	IMPORT_C void ShowBC(const CX509CertExtension& aExt);
       
    53 	IMPORT_C void ShowAltName(const CX509CertExtension& aExt);
       
    54 	IMPORT_C void ShowKU(const CX509CertExtension& aExt);
       
    55 	IMPORT_C void ShowSubtrees(const CArrayPtrFlat<CX509GeneralSubtree>& aSubtrees);
       
    56 	IMPORT_C void ShowNC(const CX509CertExtension& aExt);
       
    57 	IMPORT_C void ShowPC(const CX509CertExtension& aExt);
       
    58 	IMPORT_C void ShowCP(const CX509CertExtension& aExt);
       
    59 	IMPORT_C void ShowPM(const CX509CertExtension& aExt);
       
    60 	IMPORT_C void ShowEKU(const CX509CertExtension& aExt);
       
    61 	IMPORT_C void ShowSignature(const CX509Certificate& aCert);
       
    62 	IMPORT_C TBool IsSelfSigned(const CX509Certificate& aCert);
       
    63 private:
       
    64 	void WriteEncodings(const CX509Certificate& aCertificate);
       
    65 	void WriteEncoding(const CX509Certificate& aCertificate, const TUint aIndex);
       
    66 	void ShowRSAKey(const CSubjectPublicKeyInfo& aSpki);
       
    67 	void ShowDSAKey(const CSubjectPublicKeyInfo& aSpki);
       
    68 	void ShowDHKey(const CSubjectPublicKeyInfo& aSpki);
       
    69 	void CalculateSignature(const CX509Certificate& aCert);
       
    70 	Output* iOut;
       
    71 	};
       
    72 
       
    73 #endif