KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jmanage > webui > JettyStopKey


1 /**
2  * Copyright 2004-2005 jManage.org
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.jmanage.webui;
17
18 import org.jmanage.core.crypto.Crypto;
19
20 /**
21  * JettyStopKey provides a secure key based on the admin password,
22  * so that only admin user can shutdown the jManage process.
23  * <p>
24  * Date: Dec 3, 2005
25  * @author Rakesh Kalra
26  */

27 class JettyStopKey {
28
29     private static String JavaDoc prefix = "d39dlf931!#$1ad93F1#F40A1#931d1bs!dadbe1#45%@1";
30     private static String JavaDoc suffix = "x22D#!30d;3d#foa03#faa01#F04dcbp1E$Gea!2gd1pbie11";
31
32     private final String JavaDoc key;
33
34     public JettyStopKey(String JavaDoc password){
35         key = Crypto.hash(prefix + password + suffix);
36     }
37
38     public String JavaDoc toString(){
39         return key;
40     }
41 }
42
Popular Tags