sl@0: /* sl@0: * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * Symbian specific X509.v3 certificate extensions that constrain the sl@0: * the devices, secure ids, vendor ids and capabilities for which sl@0: * a software install signing certificate is valid. sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #ifndef __X509CONSTRAINTEXT_H__ sl@0: #define __X509CONSTRAINTEXT_H__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: class CX509IntListExt : public CX509ExtensionBase sl@0: /** sl@0: A Symbian specific X.509 v3 certificate extension that contains an arbitrary sl@0: list of 32 bit integers. sl@0: sl@0: @internalTechnology sl@0: @released sl@0: */ sl@0: { sl@0: public: sl@0: /** sl@0: Creates a new CX509IntListExt object from the binary (DER) encoded sl@0: representation of a sequence of integers. sl@0: sl@0: @param aBinaryData The encoded binary representation. sl@0: @return The new CX509IntListExt object. sl@0: */ sl@0: IMPORT_C static CX509IntListExt* NewL(const TDesC8& aBinaryData); sl@0: sl@0: /** sl@0: Creates a new CX509IntListExt object from the binary (DER) encoded sl@0: representation of a sequence of integers, and puts a pointer to it sl@0: onto the cleanup stack. sl@0: sl@0: @param aBinaryData The encoded binary representation. sl@0: @return The new CX509IntListExt object. sl@0: */ sl@0: IMPORT_C static CX509IntListExt* NewLC(const TDesC8& aBinaryData); sl@0: sl@0: /** sl@0: Destructor. sl@0: Frees all resources owned by the object. sl@0: */ sl@0: ~CX509IntListExt(); sl@0: sl@0: /** sl@0: Gets a reference to the array of decoded integers. sl@0: Ownership is not transferred. sl@0: @return A reference to the array of decoded integers. sl@0: */ sl@0: IMPORT_C const RArray& IntArray() const; sl@0: sl@0: protected: sl@0: /** Second-phase constructor. sl@0: * sl@0: * @param aBinaryData The encoded binary representation. sl@0: * @param aPos The position from which to start decoding. */ sl@0: void ConstructL(const TDesC8& aBinaryData, TInt& aPos); sl@0: sl@0: /** sl@0: Decodes the binary representation of a sequence of integers. sl@0: sl@0: @param aBinaryData The encoded binary representation. This is the same as sl@0: passed to ConstructL(). sl@0: @param aPos The position from which to start decoding. Note that sl@0: the value passed points, in effect, to the content, sl@0: bypassing the header data. sl@0: */ sl@0: void DoConstructL(const TDesC8& aBinaryData, TInt& aPos); sl@0: sl@0: private: sl@0: /** The decoded array of integers. */ sl@0: RArray iIntArray; sl@0: }; sl@0: sl@0: class CX509Utf8StringListExt : public CX509ExtensionBase sl@0: /** sl@0: A Symbian specific X.509 v3 certificate extension that contains an arbitrary sl@0: list of UTF-8 strings. sl@0: sl@0: @internalTechnology sl@0: @released sl@0: */ sl@0: { sl@0: public: sl@0: /** sl@0: Creates a new CX509Utf8StringListExt object from the binary (DER) encoded sl@0: representation of a sequence of integers. sl@0: sl@0: @param aBinaryData The encoded binary representation. sl@0: @return The new CX509Utf8StringListExt object. sl@0: */ sl@0: IMPORT_C static CX509Utf8StringListExt* NewL(const TDesC8& aBinaryData); sl@0: sl@0: /** sl@0: Creates a new CX509Utf8StringListExt object from the binary (DER) encoded sl@0: representation of a sequence of integers, and puts a pointer to it sl@0: onto the cleanup stack. sl@0: sl@0: @param aBinaryData The encoded binary representation. sl@0: @return The new CX509Utf8StringListExt object. sl@0: */ sl@0: IMPORT_C static CX509Utf8StringListExt* NewLC(const TDesC8& aBinaryData); sl@0: sl@0: /** sl@0: Destructor. sl@0: Frees all resources owned by the object. sl@0: */ sl@0: ~CX509Utf8StringListExt(); sl@0: sl@0: /** sl@0: Gets a reference to the array of decoded strings (UTF-16). sl@0: Ownership is not transferred. sl@0: @return A reference to the array of decoded strings in UTF-16. sl@0: */ sl@0: IMPORT_C const RPointerArray& StringArray() const; sl@0: sl@0: protected: sl@0: /** Second-phase constructor. sl@0: @param aBinaryData The encoded binary representation. sl@0: @param aPos The position from which to start decoding. sl@0: */ sl@0: void ConstructL(const TDesC8& aBinaryData, TInt& aPos); sl@0: sl@0: /** sl@0: Decodes the binary representation of a sequence of UTF-8 strings. The sl@0: strings are converted and stored internal as UTF-8. sl@0: sl@0: @param aBinaryData The encoded binary representation. This is the same as sl@0: passed to ConstructL(). sl@0: @param aPos The position from which to start decoding. Note that sl@0: the value passed points, in effect, to the content, sl@0: bypassing the header data. sl@0: */ sl@0: void DoConstructL(const TDesC8& aBinaryData, TInt& aPos); sl@0: sl@0: private: sl@0: /** The decoded array of strings in UTF-16. */ sl@0: RPointerArray iStringArray; sl@0: }; sl@0: sl@0: /** sl@0: A Symbian specific X.509 v3 certificate extension that contains a capability sl@0: set encoded as a bit string. sl@0: sl@0: @internalTechnology sl@0: @released sl@0: */ sl@0: class CX509CapabilitySetExt : public CX509ExtensionBase sl@0: { sl@0: public: sl@0: /** sl@0: Creates a new CX509CapabilitySetExt object from the binary (DER) encoded sl@0: representation of a sequence of integers. sl@0: sl@0: @param aBinaryData The encoded binary representation. sl@0: @return The new CX509CapabilitySetExt object. sl@0: */ sl@0: IMPORT_C static CX509CapabilitySetExt* NewL(const TDesC8& aBinaryData); sl@0: sl@0: /** sl@0: Creates a new CX509CapabilitySetExt object from the binary (DER) encoded sl@0: representation of a sequence of integers, and puts a pointer to it sl@0: onto the cleanup stack. sl@0: sl@0: @param aBinaryData The encoded binary representation. sl@0: @return The new CX509CapabilitySetExt object. sl@0: */ sl@0: IMPORT_C static CX509CapabilitySetExt* NewLC(const TDesC8& aBinaryData); sl@0: sl@0: /** sl@0: Destructor. sl@0: Frees all resources owned by the object. sl@0: */ sl@0: ~CX509CapabilitySetExt(); sl@0: sl@0: /** Gets a reference to the capability set. sl@0: @return the capability set represented by the bit string. sl@0: */ sl@0: IMPORT_C const TCapabilitySet& CapabilitySet() const; sl@0: sl@0: protected: sl@0: /** Second-phase constructor. sl@0: sl@0: @param aBinaryData The encoded binary representation. sl@0: @param aPos The position from which to start decoding. sl@0: */ sl@0: void ConstructL(const TDesC8& aBinaryData, TInt& aPos); sl@0: sl@0: /** sl@0: Constructs the a TCapabilitySet from a DER encoded bit string. sl@0: sl@0: @param aBinaryData The encoded binary representation. This is the same as sl@0: passed to ConstructL(). sl@0: @param aPos The position from which to start decoding. Note that sl@0: the value passed points, in effect, to the content, sl@0: bypassing the header data. sl@0: */ sl@0: void DoConstructL(const TDesC8& aBinaryData, TInt& aPos); sl@0: sl@0: private: sl@0: /** The decoded capability set */ sl@0: TCapabilitySet iCapabilitySet; sl@0: }; sl@0: sl@0: #endif