src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
232 * |
232 * |
233 * @return the init lifetime remaining in seconds |
233 * @return the init lifetime remaining in seconds |
234 * @exception GSSException may be thrown |
234 * @exception GSSException may be thrown |
235 */ |
235 */ |
236 public int getInitLifetime() throws GSSException { |
236 public int getInitLifetime() throws GSSException { |
237 int retVal = 0; |
|
238 Date d = getEndTime(); |
237 Date d = getEndTime(); |
239 if (d == null) { |
238 if (d == null) { |
240 return 0; |
239 return 0; |
241 } |
240 } |
242 retVal = (int)(d.getTime() - (new Date().getTime())); |
241 long retVal = d.getTime() - System.currentTimeMillis(); |
243 |
242 return (int)(retVal/1000); |
244 return retVal/1000; |
|
245 } |
243 } |
246 |
244 |
247 /** |
245 /** |
248 * Returns the accept lifetime remaining. |
246 * Returns the accept lifetime remaining. |
249 * |
247 * |