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: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: #ifndef __PKCS12ATTRIBUTE_H__ sl@0: #define __PKCS12ATTRIBUTE_H__ sl@0: sl@0: #include sl@0: sl@0: namespace PKCS12 sl@0: { sl@0: /** sl@0: This class decodes the bagAttributes present in the SafeBag. sl@0: It has methods to get the AttributeId and the AttributeValue. sl@0: */ sl@0: class CDecPkcs12Attribute : public CBase sl@0: { sl@0: public: sl@0: /** sl@0: Creates a new PKCS#12 attribute object. sl@0: sl@0: PKCS#12AttrSet ATTRIBUTE ::= { sl@0: friendlyName | sl@0: localKeyId, sl@0: ... -- Other attributes are allowed sl@0: } sl@0: sl@0: @param aBagAttributes Contains a PKCS#12 attribute set. sl@0: @return A pointer to the newly allocated object. sl@0: @leave if the bag attribute set is not a sequence or class sl@0: tag name is not Universal. sl@0: */ sl@0: IMPORT_C static CDecPkcs12Attribute* NewL(const TDesC8& aBagAttributes); sl@0: sl@0: /** sl@0: Returns the ObjectIdentifier indicating the attribute type: sl@0: - OID ---- 1.2.840.113549.1.9.20 friendlyName sl@0: - OID ---- 1.2.840.113549.1.9.21 localKeyId sl@0: @return An object identifier indicating the attribute type. sl@0: */ sl@0: IMPORT_C const TDesC& AttributeId() const; sl@0: sl@0: /** sl@0: Returns the DER encoded attribute values present in the Safe Bag. sl@0: @return The ASN1Set of attribute values sl@0: */ sl@0: IMPORT_C const RPointerArray& AttributeValue() const; sl@0: sl@0: /** sl@0: Destructor. sl@0: */ sl@0: virtual ~CDecPkcs12Attribute(); sl@0: sl@0: private: sl@0: /** sl@0: This decodes the entire BagAttributes structure sl@0: @param aBagAttributes Contains a PKCS#12 attribute set. sl@0: @leave if the bag attribute set is not a sequence or class sl@0: tag name is not Universal. sl@0: */ sl@0: void ConstructL(const TDesC8& aBagAttributes); sl@0: sl@0: /** sl@0: Construtor. sl@0: */ sl@0: CDecPkcs12Attribute(); sl@0: sl@0: /** sl@0: Copy Constructor. sl@0: @param aDecPkcs12Atrribute A CDecPkcs12Attribute object. sl@0: */ sl@0: CDecPkcs12Attribute(const CDecPkcs12Attribute& aDecPkcs12Atrribute); sl@0: sl@0: /** sl@0: Assignment operator. sl@0: @param aDecPkcs12Atrribute A CDecPkcs12Attribute object. sl@0: @return A reference to CDecPkcs12Attribute class. sl@0: */ sl@0: CDecPkcs12Attribute& operator=(const CDecPkcs12Attribute& aDecPkcs12Atrribute); sl@0: sl@0: private: sl@0: /** Contains the object identifier indicating the attribute type */ sl@0: HBufC* iAttributeId; sl@0: sl@0: /** Contains the attribute value which is an DER encoded value */ sl@0: RPointerArray iAttributeValue; sl@0: }; sl@0: } // namespace PKCS12 sl@0: #endif // __PKCS12ATTRIBUTE_H__ sl@0: sl@0: