本文整理汇总了Java中sun.security.krb5.internal.AuthorizationData.item方法的典型用法代码示例。如果您正苦于以下问题:Java AuthorizationData.item方法的具体用法?Java AuthorizationData.item怎么用?Java AuthorizationData.item使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.security.krb5.internal.AuthorizationData
的用法示例。
在下文中一共展示了AuthorizationData.item方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: inquireSecContext
import sun.security.krb5.internal.AuthorizationData; //导入方法依赖的package包/类
@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;
}
示例2: decodeAuthorizationData
import sun.security.krb5.internal.AuthorizationData; //导入方法依赖的package包/类
private Map<String, Object> decodeAuthorizationData(AuthorizationData authorizationData) throws Exception{
Map<String, Object> clientDetailsFromPac = new HashMap<String, Object>();
//Iterate through the authorizationData and find adData with adType = AD-IF-RELEVANT (1) - see RFC 4210 section 7.5.4
for( int i = 0; i < authorizationData.count(); i++) {
if (authorizationData.item(i).adType == 1){
DerInputStream adDataStream = new DerInputStream(authorizationData.item(i).adData);
DerValue[] values = adDataStream.getSet(authorizationData.item(i).adData.length, true);
//values[0] contains authorizationData entry with adType = AD-WIN2k-PAC (128) - see RFC 4210 section 7.5.4
DerValue pacDerValue = values[0];
AuthorizationDataEntry pacAuthorizationDataEntry = new AuthorizationDataEntry(pacDerValue);
if (pacAuthorizationDataEntry.adType != 128){
throw new IOException("PAC not found within authorization data as expected. Was expecting adType=128 (AD-WIN2K-PAC) within AD-IF-RELEVANT");
}
Pac pac = new Pac(pacAuthorizationDataEntry.adData, this.serverPrivateKey);
clientDetailsFromPac.put("pac", pac);
clientDetailsFromPac.put("fullName", pac.getFullName());
clientDetailsFromPac.put("groupMemberships", pac.getGroupMemberships());
clientDetailsFromPac.put("homeDirectory", pac.getHomeDirectory());
clientDetailsFromPac.put("groupCount", pac.getiGroupCount());
clientDetailsFromPac.put("kdc", pac.getKdc());
clientDetailsFromPac.put("logonCount", pac.getLogonCount());
clientDetailsFromPac.put("logonDomainName", pac.getLogonDomainName());
clientDetailsFromPac.put("passwordExpiryDateTime", pac.getPasswordExpiresDateTime());
clientDetailsFromPac.put("passwordSetDateTime", pac.getPasswordSetDateTime());
clientDetailsFromPac.put("primaryGroup", pac.getPrimaryGroup());
clientDetailsFromPac.put("profilePath", pac.getProfilePath());
}
}
return clientDetailsFromPac;
}