本文整理匯總了Java中org.ietf.jgss.GSSContext.isInitiator方法的典型用法代碼示例。如果您正苦於以下問題:Java GSSContext.isInitiator方法的具體用法?Java GSSContext.isInitiator怎麽用?Java GSSContext.isInitiator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.ietf.jgss.GSSContext
的用法示例。
在下文中一共展示了GSSContext.isInitiator方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: authorize
import org.ietf.jgss.GSSContext; //導入方法依賴的package包/類
/**
* Performs host authentication. The hostname of the peer is
* compared with the hostname specified in the peer's (topmost)
* certificate in the certificate chain. The hostnames must
* match exactly (in case-insensitive way)
*
* @param context the security context
* @param host host address of the peer.
* @exception AuthorizationException if the hostnames
* do not match.
*/
public void authorize(GSSContext context, String host)
throws AuthorizationException {
logger.debug("Authorization: HOST");
try {
GSSName expected = getExpectedName(null, host);
GSSName target = null;
if (context.isInitiator()) {
target = context.getTargName();
} else {
target = context.getSrcName();
}
if (!expected.equals(target)) {
generateAuthorizationException(expected, target);
}
} catch (GSSException e) {
throw new AuthorizationException("Authorization failure", e);
}
}
示例2: authorize
import org.ietf.jgss.GSSContext; //導入方法依賴的package包/類
/**
* Performs self authorization.
*/
public void authorize(GSSContext context, String host)
throws AuthorizationException {
logger.debug("Authorization: SELF");
try {
if (!context.getSrcName().equals(context.getTargName())) {
GSSName expected = null;
GSSName target = null;
if (context.isInitiator()) {
expected = context.getSrcName();
target = context.getTargName();
} else {
expected = context.getTargName();
target = context.getSrcName();
}
generateAuthorizationException(expected, target);
}
} catch (GSSException e) {
throw new AuthorizationException("Authorization failure", e);
}
}
示例3: authorize
import org.ietf.jgss.GSSContext; //導入方法依賴的package包/類
/**
* Performs identity authorization. The given identity is compared
* with the peer's identity.
*
* @param context the security context
* @param host host address of the peer.
* @exception AuthorizationException if the peer's
* identity does not match the expected identity.
*/
public void authorize(GSSContext context, String host)
throws AuthorizationException {
logger.debug("Authorization: IDENTITY");
try {
GSSName expected = getExpectedName(null, host);
GSSName target = null;
if (context.isInitiator()) {
target = context.getTargName();
} else {
target = context.getSrcName();
}
if (!expected.equals(target)) {
generateAuthorizationException(expected, target);
}
} catch (GSSException e) {
throw new AuthorizationException("Authorization failure", e);
}
}