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


Java Credentials.getRenewTill方法代码示例

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


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

示例1: credsToTicket

import sun.security.krb5.Credentials; //导入方法依赖的package包/类
public static KerberosTicket credsToTicket(Credentials serviceCreds) {
    EncryptionKey sessionKey =  serviceCreds.getSessionKey();
    return new KerberosTicket(
        serviceCreds.getEncoded(),
        new KerberosPrincipal(serviceCreds.getClient().getName()),
        new KerberosPrincipal(serviceCreds.getServer().getName(),
                            KerberosPrincipal.KRB_NT_SRV_INST),
        sessionKey.getBytes(),
        sessionKey.getEType(),
        serviceCreds.getFlags(),
        serviceCreds.getAuthTime(),
        serviceCreds.getStartTime(),
        serviceCreds.getEndTime(),
        serviceCreds.getRenewTill(),
        serviceCreds.getClientAddresses());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:Krb5Util.java

示例2: renewCredentials

import sun.security.krb5.Credentials; //导入方法依赖的package包/类
private Credentials renewCredentials(Credentials creds)
{
    Credentials lcreds;
    try {
        if (!creds.isRenewable())
            throw new RefreshFailedException("This ticket" +
                            " is not renewable");
        if (creds.getRenewTill() == null) {
            // Renewable ticket without renew-till. Illegal and ignored.
            return creds;
        }
        if (System.currentTimeMillis() > cred.getRenewTill().getTime())
            throw new RefreshFailedException("This ticket is past "
                                         + "its last renewal time.");
        lcreds = creds.renew();
        if (debug)
            System.out.println("Renewed Kerberos Ticket");
    } catch (Exception e) {
        lcreds = null;
        if (debug)
            System.out.println("Ticket could not be renewed : "
                            + e.getMessage());
    }
    return lcreds;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:Krb5LoginModule.java


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