JavaTM 2 Platform
Standard Ed. 6

java.security
类 Timestamp

java.lang.Object
  继承者 java.security.Timestamp
所有已实现的接口:
Serializable

public final class Timestamp
extends Object
implements Serializable

此类封装有关签署时间戳的信息。其不可更改。它包括时间戳的日期和时间,以及有关生成和签署时间戳的 Timestamping Authority (TSA) 的信息。

从以下版本开始:
1.5
另请参见:
序列化表格

构造方法摘要
Timestamp(Date timestamp, CertPath signerCertPath)
          构造一个时间戳。
 
方法摘要
 boolean equals(Object obj)
          比较指定的对象和此时间戳之间的相同性。
 CertPath getSignerCertPath()
          返回 Timestamping Authority 的证书路径。
 Date getTimestamp()
          返回生成时间戳时的日期和时间。
 int hashCode()
          返回此时间戳的哈希码值。
 String toString()
          返回描述此时间戳的字符串。
 
从类 java.lang.Object 继承的方法
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

Timestamp

public Timestamp(Date timestamp,
                 CertPath signerCertPath)
构造一个时间戳。

参数:
timestamp - 其为时间戳的日期和时间。它不能为 null。
signerCertPath - 其为 TSA 的证书路径。它不能为 null。
抛出:
NullPointerException - 如果时间戳或 signerCertPath 为 null。
方法详细信息

getTimestamp

public Date getTimestamp()
返回生成时间戳时的日期和时间。

返回:
时间戳的日期和时间。

getSignerCertPath

public CertPath getSignerCertPath()
返回 Timestamping Authority 的证书路径。

返回:
TSA 的证书路径。

hashCode

public int hashCode()
返回此时间戳的哈希码值。哈希码通过使用时间戳的日期和时间以及 TSA 的证书路径生成。

覆盖:
Object 中的 hashCode
返回:
此时间戳的哈希码值。
另请参见:
Object.equals(java.lang.Object), Hashtable

equals

public boolean equals(Object obj)
比较指定的对象和此时间戳之间的相同性。如果两个时间戳的日期和时间以及它们的签署人的证书路径都相同,则视其为相同。

覆盖:
Object 中的 equals
参数:
obj - 要与此时间戳进行相同性比较的对象。
返回:
如果时间戳相同,则返回 true;否则,返回 false。
另请参见:
Object.hashCode(), Hashtable

toString

public String toString()
返回描述此时间戳的字符串。

覆盖:
Object 中的 toString
返回:
构成时间戳的日期和时间及其签署人证书的字符串。

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only