当前位置: 首页>>代码示例>>Java>>正文


Java Krb5.DEBUG属性代码示例

本文整理汇总了Java中sun.security.krb5.internal.Krb5.DEBUG属性的典型用法代码示例。如果您正苦于以下问题:Java Krb5.DEBUG属性的具体用法?Java Krb5.DEBUG怎么用?Java Krb5.DEBUG使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在sun.security.krb5.internal.Krb5的用法示例。


在下文中一共展示了Krb5.DEBUG属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: send

/**
 * Communication until AS-REP or non preauth-related KRB-ERROR received
 * @throws KrbException
 * @throws IOException
 */
private KrbAsReqBuilder send() throws KrbException, IOException {
    boolean preAuthFailedOnce = false;
    KdcComm comm = new KdcComm(cname.getRealmAsString());
    EncryptionKey pakey = null;
    while (true) {
        try {
            req = build(pakey);
            rep = new KrbAsRep(comm.send(req.encoding()));
            return this;
        } catch (KrbException ke) {
            if (!preAuthFailedOnce && (
                    ke.returnCode() == Krb5.KDC_ERR_PREAUTH_FAILED ||
                    ke.returnCode() == Krb5.KDC_ERR_PREAUTH_REQUIRED)) {
                if (Krb5.DEBUG) {
                    System.out.println("KrbAsReqBuilder: " +
                            "PREAUTH FAILED/REQ, re-send AS-REQ");
                }
                preAuthFailedOnce = true;
                KRBError kerr = ke.getError();
                int paEType = PAData.getPreferredEType(kerr.getPA(),
                        EType.getDefaults("default_tkt_enctypes")[0]);
                if (password == null) {
                    EncryptionKey[] ks = Krb5Util.keysFromJavaxKeyTab(ktab, cname);
                    pakey = EncryptionKey.findKey(paEType, ks);
                    if (pakey != null) pakey = (EncryptionKey)pakey.clone();
                    for (EncryptionKey k: ks) k.destroy();
                } else {
                    pakey = EncryptionKey.acquireSecretKey(cname,
                            password,
                            paEType,
                            PAData.getSaltAndParams(
                                paEType, kerr.getPA()));
                }
                paList = kerr.getPA();  // Update current paList
            } else {
                throw ke;
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:45,代码来源:KrbAsReqBuilder.java

示例2: send

/**
 * Communication until AS-REP or non preauth-related KRB-ERROR received
 * @throws KrbException
 * @throws IOException
 */
private KrbAsReqBuilder send() throws KrbException, IOException {
    boolean preAuthFailedOnce = false;
    KdcComm comm = new KdcComm(cname.getRealmAsString());
    EncryptionKey pakey = null;
    while (true) {
        try {
            req = build(pakey);
            rep = new KrbAsRep(comm.send(req.encoding()));
            return this;
        } catch (KrbException ke) {
            if (!preAuthFailedOnce && (
                    ke.returnCode() == Krb5.KDC_ERR_PREAUTH_FAILED ||
                    ke.returnCode() == Krb5.KDC_ERR_PREAUTH_REQUIRED)) {
                if (Krb5.DEBUG) {
                    System.out.println("KrbAsReqBuilder: " +
                            "PREAUTH FAILED/REQ, re-send AS-REQ");
                }
                preAuthFailedOnce = true;
                KRBError kerr = ke.getError();
                if (password == null) {
                    EncryptionKey[] ks = Krb5Util.keysFromJavaxKeyTab(ktab, cname);
                    pakey = EncryptionKey.findKey(kerr.getEType(), ks);
                    if (pakey != null) pakey = (EncryptionKey)pakey.clone();
                    for (EncryptionKey k: ks) k.destroy();
                } else {
                    PAData.SaltAndParams snp = PAData.getSaltAndParams(
                            kerr.getEType(), kerr.getPA());
                    if (kerr.getEType() == 0) {
                        // Possible if PA-PW-SALT is in KRB-ERROR. RFC
                        // does not recommend this
                        pakey = EncryptionKey.acquireSecretKey(password,
                                snp.salt == null ? cname.getSalt() : snp.salt,
                                EType.getDefaults("default_tkt_enctypes")[0],
                                null);
                    } else {
                        pakey = EncryptionKey.acquireSecretKey(password,
                                snp.salt == null ? cname.getSalt() : snp.salt,
                                kerr.getEType(),
                                snp.params);
                    }
                }
                paList = kerr.getPA();  // Update current paList
            } else {
                throw ke;
            }
        }
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:53,代码来源:KrbAsReqBuilder.java


注:本文中的sun.security.krb5.internal.Krb5.DEBUG属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。