natfw/natfwunsaf_protocols/unsaf_codec/src/natfwunsafsharedsecretresponse.cpp
changeset 0 1bce908db942
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/natfw/natfwunsaf_protocols/unsaf_codec/src/natfwunsafsharedsecretresponse.cpp	Tue Feb 02 01:04:58 2010 +0200
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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 "natfwunsafsharedsecretresponse.h"
+
+// -----------------------------------------------------------------------------
+// CNATFWUNSAFSharedSecretResponse::NewL
+// -----------------------------------------------------------------------------
+//
+CNATFWUNSAFSharedSecretResponse* CNATFWUNSAFSharedSecretResponse::NewL(
+    const TNATFWUNSAFTransactionID& aTransactionID)
+    {
+    CNATFWUNSAFSharedSecretResponse* self =
+        CNATFWUNSAFSharedSecretResponse::NewLC(aTransactionID);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CNATFWUNSAFSharedSecretResponse::NewLC
+// -----------------------------------------------------------------------------
+//
+CNATFWUNSAFSharedSecretResponse* CNATFWUNSAFSharedSecretResponse::NewLC(
+    const TNATFWUNSAFTransactionID& aTransactionID)
+    {
+    CNATFWUNSAFSharedSecretResponse* self =
+        new (ELeave) CNATFWUNSAFSharedSecretResponse(aTransactionID);
+    CleanupStack::PushL(self);
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CNATFWUNSAFSharedSecretResponse::CreateL
+// -----------------------------------------------------------------------------
+//
+CNATFWUNSAFMessage* CNATFWUNSAFSharedSecretResponse::CreateL(
+    const TNATFWUNSAFTransactionID& aTransactionID)
+    {
+    return NewL(aTransactionID);
+    }
+
+// -----------------------------------------------------------------------------
+// CNATFWUNSAFSharedSecretResponse::CNATFWUNSAFSharedSecretResponse
+// -----------------------------------------------------------------------------
+//
+CNATFWUNSAFSharedSecretResponse::CNATFWUNSAFSharedSecretResponse(
+    const TNATFWUNSAFTransactionID& aTransactionID) :
+    CNATFWUNSAFMessage(aTransactionID)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CNATFWUNSAFSharedSecretResponse::~CNATFWUNSAFSharedSecretResponse
+// -----------------------------------------------------------------------------
+//
+CNATFWUNSAFSharedSecretResponse::~CNATFWUNSAFSharedSecretResponse()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CNATFWUNSAFSharedSecretResponse::Type
+// -----------------------------------------------------------------------------
+//
+CNATFWUNSAFMessage::TType CNATFWUNSAFSharedSecretResponse::Type() const
+    {
+    return CNATFWUNSAFMessage::ESharedSecretResponse;
+    }
+
+// -----------------------------------------------------------------------------
+// CNATFWUNSAFSharedSecretResponse::Validate
+// -----------------------------------------------------------------------------
+//
+TBool CNATFWUNSAFSharedSecretResponse::Validate() const
+    {
+    return (HasAttribute(CNATFWUNSAFAttribute::EUsername) &&
+            HasAttribute(CNATFWUNSAFAttribute::EPassword));
+    }
+
+// -----------------------------------------------------------------------------
+// CNATFWUNSAFSharedSecretResponse::IsAllowed
+// -----------------------------------------------------------------------------
+//
+TBool CNATFWUNSAFSharedSecretResponse::IsAllowed(TUint16 aAttributeType) const
+    {
+    return (aAttributeType == CNATFWUNSAFAttribute::EUsername ||
+            aAttributeType == CNATFWUNSAFAttribute::EPassword ||
+            aAttributeType == CNATFWUNSAFAttribute::ERealm ||
+            aAttributeType == CNATFWUNSAFAttribute::EMessageIntegrity ||
+            aAttributeType == CNATFWUNSAFAttribute::EFingerprint);
+    }