01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.ietf.jgss;
19:
20: import java.security.AccessController;
21: import java.security.Provider;
22:
23: import org.apache.harmony.security.fortress.PolicyUtils;
24:
25: public abstract class GSSManager {
26:
27: static final String MANAGER = "jgss.spi.manager"; //$NON-NLS-1$
28:
29: /**
30: * The implementation class name should be specified via
31: * "jgss.spi.manager" security property.
32: *
33: * @throws SecurityException if manager instance cannot be created
34: */
35: public static GSSManager getInstance() {
36: return AccessController
37: .doPrivileged(new PolicyUtils.ProviderLoader<GSSManager>(
38: MANAGER, GSSManager.class));
39: }
40:
41: public abstract Oid[] getMechs();
42:
43: public abstract Oid[] getNamesForMech(Oid mech) throws GSSException;
44:
45: public abstract Oid[] getMechsForName(Oid nameType);
46:
47: public abstract GSSName createName(String nameStr, Oid nameType)
48: throws GSSException;
49:
50: public abstract GSSName createName(byte[] name, Oid nameType)
51: throws GSSException;
52:
53: public abstract GSSName createName(String nameStr, Oid nameType,
54: Oid mech) throws GSSException;
55:
56: public abstract GSSName createName(byte[] name, Oid nameType,
57: Oid mech) throws GSSException;
58:
59: public abstract GSSCredential createCredential(int usage)
60: throws GSSException;
61:
62: public abstract GSSCredential createCredential(GSSName name,
63: int lifetime, Oid mech, int usage) throws GSSException;
64:
65: public abstract GSSCredential createCredential(GSSName name,
66: int lifetime, Oid[] mechs, int usage) throws GSSException;
67:
68: public abstract GSSContext createContext(GSSName peer, Oid mech,
69: GSSCredential myCred, int lifetime) throws GSSException;
70:
71: public abstract GSSContext createContext(GSSCredential myCred)
72: throws GSSException;
73:
74: public abstract GSSContext createContext(byte[] interProcessToken)
75: throws GSSException;
76:
77: public abstract void addProviderAtFront(Provider p, Oid mech)
78: throws GSSException;
79:
80: public abstract void addProviderAtEnd(Provider p, Oid mech)
81: throws GSSException;
82: }
|