hti/HtiFramework/src/HtiSecurityManager.cpp
changeset 0 a03f92240627
equal deleted inserted replaced
-1:000000000000 0:a03f92240627
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Empty implementation of the default HtiSecurityManager
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "HtiSecurityManager.h"
       
    20 
       
    21 CHtiSecurityManager* CHtiSecurityManager::NewL()
       
    22     {
       
    23     CHtiSecurityManager* obj = NewLC();
       
    24     CleanupStack::Pop();
       
    25     return obj;
       
    26     }
       
    27 
       
    28 CHtiSecurityManager* CHtiSecurityManager::NewLC()
       
    29     {
       
    30     CHtiSecurityManager* obj = new (ELeave) CHtiSecurityManager;
       
    31     CleanupStack::PushL(obj);
       
    32     obj->ConstructL();
       
    33     return obj;
       
    34     }
       
    35 
       
    36 CHtiSecurityManager::CHtiSecurityManager()
       
    37     {
       
    38     iSecurityContext = EFalse;
       
    39     }
       
    40 
       
    41 void CHtiSecurityManager::ConstructL()
       
    42     {
       
    43     }
       
    44 
       
    45 CHtiSecurityManager::~CHtiSecurityManager()
       
    46     {
       
    47     }
       
    48 
       
    49 TDesC8* CHtiSecurityManager::SetSecurityContext(const TDesC8& /*aToken*/)
       
    50     {
       
    51     iSecurityContext = ETrue;
       
    52     HBufC8* replyToken = HBufC8::NewL(0);
       
    53     return replyToken; //null token
       
    54     }
       
    55 
       
    56 void CHtiSecurityManager::ResetSecurityContext()
       
    57     {
       
    58     iSecurityContext = EFalse;
       
    59     }
       
    60 
       
    61 TBool CHtiSecurityManager::IsContextEstablashed() const
       
    62     {
       
    63     return iSecurityContext;
       
    64     }
       
    65 
       
    66 TDesC8* CHtiSecurityManager::WrapL(const TDesC8& aMessage, TBool /*aEncrypt*/)
       
    67     {
       
    68     //just copy message
       
    69     HBufC8* wrapped = HBufC8::NewLC( aMessage.Size() );
       
    70     (*wrapped) = aMessage;
       
    71     CleanupStack::Pop();
       
    72     return wrapped;
       
    73     }
       
    74 
       
    75 TDesC8* CHtiSecurityManager::UnwrapL(const TDesC8& aMessage)
       
    76     {
       
    77     //just copy message
       
    78     HBufC8* unwrapped = HBufC8::NewLC( aMessage.Size() );
       
    79     (*unwrapped) = aMessage;
       
    80     CleanupStack::Pop();
       
    81     return unwrapped;
       
    82     }
       
    83 
       
    84 TPtrC8 CHtiSecurityManager::MIC(const TDesC8& /*aMessage*/) const
       
    85     {
       
    86     return TPtrC8(KNullDesC8);
       
    87     }
       
    88