javacommons/gcfprotocols/secureconnection/javasrc/com/nokia/mj/impl/gcf/protocol/ssl/SSLPermissionImpl.java
changeset 21 2a9601315dfc
child 46 4376525cdefb
equal deleted inserted replaced
18:e8e63152f320 21:2a9601315dfc
       
     1 /*
       
     2 * Copyright (c) 2008 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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 package com.nokia.mj.impl.gcf.protocol.ssl;
       
    20 
       
    21 import com.nokia.mj.impl.security.common.PermissionBase;
       
    22 import java.security.Permission;
       
    23 import java.security.PermissionCollection;
       
    24 import com.nokia.mj.impl.security.utils.SecurityPromptMessage;
       
    25 
       
    26 public class SSLPermissionImpl extends PermissionBase
       
    27 {
       
    28 
       
    29     /**
       
    30      * Returns the question (as localized text) associated with the security
       
    31      * prompt
       
    32      *
       
    33      * @return the localized text associated with the security prompt
       
    34      */
       
    35 
       
    36     public SSLPermissionImpl(String uri)
       
    37     {
       
    38         super(uri);
       
    39     }
       
    40 
       
    41     public String getSecurityPromptQuestion(int aInteractionMode)
       
    42     {
       
    43         // either provide own localized text
       
    44         // or use the pre-defined texts
       
    45         // Note: some permissions use the same text always (case in which the
       
    46         // ID and the params for the text could be chosen at this phase) and
       
    47         // some permissions use a more dynamic text, depending on the context
       
    48         // in which they are used, case in which the ID and the params could
       
    49         // come from the constructor
       
    50 
       
    51         return (SecurityPromptMessage.getInstance()).getText(
       
    52                    SecurityPromptMessage.QUESTION_ID_NETWORK_USAGE, null);
       
    53 
       
    54     }
       
    55 
       
    56     public String toString()
       
    57     {
       
    58         return "javax.microedition.io.SSLProtocolPermission";
       
    59     }
       
    60 
       
    61     public boolean implies(Permission p)
       
    62     {
       
    63         if (p instanceof SSLPermissionImpl)
       
    64         {
       
    65             return true;
       
    66         }
       
    67         return false;
       
    68     }
       
    69 
       
    70     public boolean equals(Object obj)
       
    71     {
       
    72         return true;
       
    73     }
       
    74 
       
    75     public int hashCode()
       
    76     {
       
    77         return 0;
       
    78     }
       
    79 
       
    80     public String getActions()
       
    81     {
       
    82         return "";
       
    83     }
       
    84 
       
    85     public PermissionCollection newPermissionCollection()
       
    86     {
       
    87         return null;
       
    88     }
       
    89 }