< prev index next >
src/jdk.security.jgss/share/classes/com/sun/security/jgss/ExtendedGSSContext.java
Print this page
rev 14722 : imported patch 8153362
*** 34,77 ****
* functionalities not defined by {@code org.ietf.jgss.GSSContext},
* such as querying context-specific attributes.
*/
public interface ExtendedGSSContext extends GSSContext {
- // The impl is almost identical to GSSContextImpl with only 2 differences:
- // 1. It implements the extended interface
- // 2. It translates result to data types here in inquireSecContext
- static class ExtendedGSSContextImpl extends GSSContextImpl
- implements ExtendedGSSContext {
-
- public ExtendedGSSContextImpl(GSSContextImpl old) {
- super(old);
- }
-
- @Override
- public Object inquireSecContext(InquireType type) throws GSSException {
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- security.checkPermission(
- new InquireSecContextPermission(type.toString()));
- }
- Object output = super.inquireSecContext(type.name());
- if (output != null) {
- if (type == InquireType.KRB5_GET_AUTHZ_DATA) {
- AuthorizationData ad = (AuthorizationData) output;
- AuthorizationDataEntry[] authzData =
- new AuthorizationDataEntry[ad.count()];
- for (int i = 0; i < ad.count(); i++) {
- authzData[i] = new AuthorizationDataEntry(
- ad.item(i).adType, ad.item(i).adData);
- }
- output = authzData;
- }
- }
- return output;
- }
- }
-
/**
* Return the mechanism-specific attribute associated with {@code type}.
* <p>
* If there is a security manager, an {@link InquireSecContextPermission}
* with the name {@code type.mech} must be granted. Otherwise, this could
--- 34,43 ----
< prev index next >