java.security
Class CodeSigner

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.security.CodeSigner
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public final class CodeSigner
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Serializable sample code for java.io.Serializable definition code for java.io.Serializable

This class encapsulates information about a code signer. It is immutable.

Since:
1.5
See Also:
Serialized Form

Constructor Summary
CodeSigner sample code for java.security.CodeSigner.CodeSigner(java.security.cert.CertPath, java.security.Timestamp) definition code for java.security.CodeSigner.CodeSigner(java.security.cert.CertPath, java.security.Timestamp) (CertPath sample code for java.security.cert.CertPath definition code for java.security.cert.CertPath  signerCertPath, Timestamp sample code for java.security.Timestamp definition code for java.security.Timestamp  timestamp)
          Constructs a CodeSigner object.
 
Method Summary
 boolean equals sample code for java.security.CodeSigner.equals(java.lang.Object) definition code for java.security.CodeSigner.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Tests for equality between the specified object and this code signer.
 CertPath sample code for java.security.cert.CertPath definition code for java.security.cert.CertPath getSignerCertPath sample code for java.security.CodeSigner.getSignerCertPath() definition code for java.security.CodeSigner.getSignerCertPath() ()
          Returns the signer's certificate path.
 Timestamp sample code for java.security.Timestamp definition code for java.security.Timestamp getTimestamp sample code for java.security.CodeSigner.getTimestamp() definition code for java.security.CodeSigner.getTimestamp() ()
          Returns the signature timestamp.
 int hashCode sample code for java.security.CodeSigner.hashCode() definition code for java.security.CodeSigner.hashCode() ()
          Returns the hash code value for this code signer.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for java.security.CodeSigner.toString() definition code for java.security.CodeSigner.toString() ()
          Returns a string describing this code signer.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

CodeSigner sample code for java.security.CodeSigner(java.security.cert.CertPath, java.security.Timestamp) definition code for java.security.CodeSigner(java.security.cert.CertPath, java.security.Timestamp)

public CodeSigner(CertPath sample code for java.security.cert.CertPath definition code for java.security.cert.CertPath  signerCertPath,
                  Timestamp sample code for java.security.Timestamp definition code for java.security.Timestamp  timestamp)
Constructs a CodeSigner object.

Parameters:
signerCertPath - The signer's certificate path. It must not be null.
timestamp - A signature timestamp. If null then no timestamp was generated for the signature.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if signerCertPath is null.
Method Detail

getSignerCertPath sample code for java.security.CodeSigner.getSignerCertPath() definition code for java.security.CodeSigner.getSignerCertPath()

public CertPath sample code for java.security.cert.CertPath definition code for java.security.cert.CertPath  getSignerCertPath()
Returns the signer's certificate path.

Returns:
A certificate path.

getTimestamp sample code for java.security.CodeSigner.getTimestamp() definition code for java.security.CodeSigner.getTimestamp()

public Timestamp sample code for java.security.Timestamp definition code for java.security.Timestamp  getTimestamp()
Returns the signature timestamp.

Returns:
The timestamp or null if none is present.

hashCode sample code for java.security.CodeSigner.hashCode() definition code for java.security.CodeSigner.hashCode()

public int hashCode()
Returns the hash code value for this code signer. The hash code is generated using the signer's certificate path and the timestamp, if present.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code value for this code signer.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

equals sample code for java.security.CodeSigner.equals(java.lang.Object) definition code for java.security.CodeSigner.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Tests for equality between the specified object and this code signer. Two code signers are considered equal if their signer certificate paths are equal and if their timestamps are equal, if present in both.

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
obj - the object to test for equality with this object.
Returns:
true if the objects are considered equal, false otherwise.
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

toString sample code for java.security.CodeSigner.toString() definition code for java.security.CodeSigner.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
Returns a string describing this code signer.

Overrides:
toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
A string comprising the signer's certificate and a timestamp, if present.