001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.ietf.jgss;
019:
020: import java.io.InputStream;
021: import java.io.OutputStream;
022:
023: public interface GSSContext {
024:
025: static final int DEFAULT_LIFETIME = 0;
026:
027: static final int INDEFINITE_LIFETIME = Integer.MAX_VALUE;//2147483647;
028:
029: byte[] initSecContext(byte[] inputBuf, int offset, int len)
030: throws GSSException;
031:
032: int initSecContext(InputStream inStream, OutputStream outStream)
033: throws GSSException;
034:
035: byte[] acceptSecContext(byte[] inToken, int offset, int len)
036: throws GSSException;
037:
038: void acceptSecContext(InputStream inStream, OutputStream outStream)
039: throws GSSException;
040:
041: boolean isEstablished();
042:
043: void dispose() throws GSSException;
044:
045: int getWrapSizeLimit(int qop, boolean confReq, int maxTokenSize)
046: throws GSSException;
047:
048: byte[] wrap(byte[] inBuf, int offset, int len, MessageProp msgProp)
049: throws GSSException;
050:
051: void wrap(InputStream inStream, OutputStream outStream,
052: MessageProp msgProp) throws GSSException;
053:
054: byte[] unwrap(byte[] inBuf, int offset, int len, MessageProp msgProp)
055: throws GSSException;
056:
057: void unwrap(InputStream inStream, OutputStream outStream,
058: MessageProp msgProp) throws GSSException;
059:
060: byte[] getMIC(byte[] inMsg, int offset, int len, MessageProp msgProp)
061: throws GSSException;
062:
063: void getMIC(InputStream inStream, OutputStream outStream,
064: MessageProp msgProp) throws GSSException;
065:
066: void verifyMIC(byte[] inToken, int tokOffset, int tokLen,
067: byte[] inMsg, int msgOffset, int msgLen, MessageProp msgProp)
068: throws GSSException;
069:
070: void verifyMIC(InputStream tokStream, InputStream msgStream,
071: MessageProp msgProp) throws GSSException;
072:
073: byte[] export() throws GSSException;
074:
075: void requestMutualAuth(boolean state) throws GSSException;
076:
077: void requestReplayDet(boolean state) throws GSSException;
078:
079: void requestSequenceDet(boolean state) throws GSSException;
080:
081: void requestCredDeleg(boolean state) throws GSSException;
082:
083: void requestAnonymity(boolean state) throws GSSException;
084:
085: void requestConf(boolean state) throws GSSException;
086:
087: void requestInteg(boolean state) throws GSSException;
088:
089: void requestLifetime(int lifetime) throws GSSException;
090:
091: void setChannelBinding(ChannelBinding cb) throws GSSException;
092:
093: boolean getCredDelegState();
094:
095: boolean getMutualAuthState();
096:
097: boolean getReplayDetState();
098:
099: boolean getSequenceDetState();
100:
101: boolean getAnonymityState();
102:
103: boolean isTransferable() throws GSSException;
104:
105: boolean isProtReady();
106:
107: boolean getConfState();
108:
109: boolean getIntegState();
110:
111: int getLifetime();
112:
113: GSSName getSrcName() throws GSSException;
114:
115: GSSName getTargName() throws GSSException;
116:
117: Oid getMech() throws GSSException;
118:
119: GSSCredential getDelegCred() throws GSSException;
120:
121: boolean isInitiator() throws GSSException;
122: }
|