diff -r 000000000000 -r 2c201484c85f securityanddataprivacytools/securitytools/certapp/encdec/certinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/securityanddataprivacytools/securitytools/certapp/encdec/certinfo.h Wed Jul 08 11:25:26 2009 +0100 @@ -0,0 +1,85 @@ +#ifndef __CERTINFO_H__ +#define __CERTINFO_H__ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "encdec.h" +#include "x509utils.h" + +/** + * @file + * @internalComponent + */ +/** + * The owner of a certificate. + * + */ +enum TCertificateOwnerType + { + ECACertificate, + EUserCertificate, + EPeerCertificate + }; + +const TUint32 KMaxCertLabelLength = 64; +typedef TBuf TCertLabel; +void EncodeHuman(REncodeWriteStream& aStream,const TCertLabel &aLabel); +void DecodeHuman(RDecodeReadStream& aStream,TCertLabel &aLabel); + +class CertInfo + { +public: + CertInfo(bool aSwiMode); + + void Encode(REncodeWriteStream &aWriteStream); + void Decode(RDecodeReadStream &aReadStream); + + TUint32 CertSize() const; + void SetCertSize(TUint32 aSize); + + const TCertLabel &Label() const; + TCertLabel &Label(); + + TCertificateFormat CertificateFormat() const; + + KeyIdentifierObject &SubjectKeyId(); + const KeyIdentifierObject &SubjectKeyId() const; + KeyIdentifierObject &IssuerKeyId(); + const KeyIdentifierObject &IssuerKeyId() const; + + + TUint32 OutputCertificateId() const; + void SetOutputCertificateId(TUint32 aId); + +private: + EncDecObject iTmpCombinedDeletableAndFormat; + EncDecEnum iDeletable; + EncDecEnum iFormat; // TCertificateFormat + + EncDecObject iSize; + EncDecObject iLabel; + EncDecObject iReadCertificateId; // Read from binary, written to human + EncDecObject iWriteCertificateId; // Written to binary + EncDecEnum iCertificateOwnerType; // TCertificateOwnerType + EncDecObject iSubjectKeyId; + EncDecObject iIssuerKeyId; + + bool iSwiMode; + }; + +#endif