os/security/cryptoservices/certificateandkeymgmt/tcertcommon/tcertwriter.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/cryptoservices/certificateandkeymgmt/tcertcommon/tcertwriter.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,72 @@
     1.4 +/*
     1.5 +* Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +* CertWriter class implementation
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +/**
    1.24 + @file 
    1.25 + @internalTechnology
    1.26 +*/
    1.27 + 
    1.28 +#ifndef __TCERTWRITER_H__
    1.29 +#define __TCERTWRITER_H__
    1.30 +
    1.31 +#include "t_output.h"
    1.32 +#include <x509cert.h>
    1.33 +#include <x509gn.h>
    1.34 +#include <x509certext.h>
    1.35 +
    1.36 +class CertWriter
    1.37 +	{
    1.38 +public:
    1.39 +	IMPORT_C CertWriter(Output* aOut);
    1.40 +	IMPORT_C void SetOut(Output* aOut);
    1.41 +	IMPORT_C void WriteCert(const CX509Certificate& aCertificate);
    1.42 +	IMPORT_C void ShowSigningAlgorithm(const CSigningAlgorithmIdentifier& aSigningAlgorithm);
    1.43 +	IMPORT_C void ShowPublicKey(const CX509Certificate& aCertificate);
    1.44 +	IMPORT_C void ShowSerialNumber(const TPtrC8& aSerialNumber);
    1.45 +	IMPORT_C void ShowAVA(const CX520AttributeTypeAndValue& aAva);
    1.46 +	IMPORT_C void ShowDN(const CX500DistinguishedName& aName);
    1.47 +	IMPORT_C void ShowAKI(const CX509Certificate& aCert);
    1.48 +	IMPORT_C void ShowSKI(const CX509Certificate& aCert);
    1.49 +	IMPORT_C void ShowGN(const CX509GeneralName& aName);
    1.50 +	IMPORT_C void ShowFingerprint(const CX509Certificate& aCertificate);
    1.51 +	IMPORT_C void ShowExtensions(const CX509Certificate& aCertificate);
    1.52 +	IMPORT_C void ShowValidityPeriod(const CX509Certificate& aCertificate);
    1.53 +	IMPORT_C void ShowBC(const CX509CertExtension& aExt);
    1.54 +	IMPORT_C void ShowAltName(const CX509CertExtension& aExt);
    1.55 +	IMPORT_C void ShowKU(const CX509CertExtension& aExt);
    1.56 +	IMPORT_C void ShowSubtrees(const CArrayPtrFlat<CX509GeneralSubtree>& aSubtrees);
    1.57 +	IMPORT_C void ShowNC(const CX509CertExtension& aExt);
    1.58 +	IMPORT_C void ShowPC(const CX509CertExtension& aExt);
    1.59 +	IMPORT_C void ShowCP(const CX509CertExtension& aExt);
    1.60 +	IMPORT_C void ShowPM(const CX509CertExtension& aExt);
    1.61 +	IMPORT_C void ShowEKU(const CX509CertExtension& aExt);
    1.62 +	IMPORT_C void ShowSignature(const CX509Certificate& aCert);
    1.63 +	IMPORT_C TBool IsSelfSigned(const CX509Certificate& aCert);
    1.64 +private:
    1.65 +	void WriteEncodings(const CX509Certificate& aCertificate);
    1.66 +	void WriteEncoding(const CX509Certificate& aCertificate, const TUint aIndex);
    1.67 +	void ShowRSAKey(const CSubjectPublicKeyInfo& aSpki);
    1.68 +	void ShowDSAKey(const CSubjectPublicKeyInfo& aSpki);
    1.69 +	void ShowDHKey(const CSubjectPublicKeyInfo& aSpki);
    1.70 +	void CalculateSignature(const CX509Certificate& aCert);
    1.71 +	Output* iOut;
    1.72 +	};
    1.73 +
    1.74 +#endif
    1.75 +