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