Top Description Fields Constructors Methods
java.security

public final Class CodeSigner

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.*, java.security.cert.CertPath, java.util.Objects

This class encapsulates information about a code signer. It is immutable.
Author
Vincent Ryan
Since
1.5

Field Summary

Modifier and TypeField and Description
private transient int
private static final long
private final CertPath
signerCertPath

The signer's certificate path.

private final Timestamp
timestamp

The signature timestamp.

Constructor Summary

AccessConstructor and Description
public
CodeSigner(CertPath
The signer's certificate path. It must not be null.
signerCertPath
,
Timestamp
A signature timestamp. If null then no timestamp was generated for the signature.
timestamp
)

Constructs a CodeSigner object.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the objects are considered equal, false otherwise.
equals
(Object
the object to test for equality with this object.
obj
)

Overrides java.lang.Object.equals.

Tests for equality between the specified object and this code signer.

public CertPath

Returns:

A certificate path.
getSignerCertPath
()

Returns the signer's certificate path.

public Timestamp

Returns:

The timestamp or null if none is present.
getTimestamp
()

Returns the signature timestamp.

public int

Returns:

the hash code value for this code signer
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hash code value for this code signer.

private void
readObject(ObjectInputStream
the ObjectInputStream from which data is read
ois
)

Restores the state of this object from the stream, and explicitly resets hash code value to -1.

public String

Returns:

A string comprising the signer's certificate and a timestamp, if present.
toString
()

Overrides java.lang.Object.toString.

Returns a string describing this code signer.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

myhashback to summary
private transient int myhash
serialVersionUIDback to summary
private static final long serialVersionUID
Annotations
@Serial
signerCertPathback to summary
private final CertPath signerCertPath

The signer's certificate path.

timestampback to summary
private final Timestamp timestamp

The signature timestamp.

Constructor Detail

CodeSignerback to summary
public CodeSigner(CertPath signerCertPath, Timestamp timestamp)

Constructs a CodeSigner object.

Parameters
signerCertPath:CertPath

The signer's certificate path. It must not be null.

timestamp:Timestamp

A signature timestamp. If null then no timestamp was generated for the signature.

Exceptions
NullPointerException:
if signerCertPath is null.

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

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.

Parameters
obj:Object

the object to test for equality with this object.

Returns:boolean

true if the objects are considered equal, false otherwise.

Annotations
@Override
getSignerCertPathback to summary
public CertPath getSignerCertPath()

Returns the signer's certificate path.

Returns:CertPath

A certificate path.

getTimestampback to summary
public Timestamp getTimestamp()

Returns the signature timestamp.

Returns:Timestamp

The timestamp or null if none is present.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.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.

Returns:int

the hash code value for this code signer

Annotations
@Override
readObjectback to summary
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException

Restores the state of this object from the stream, and explicitly resets hash code value to -1.

Parameters
ois:ObjectInputStream

the ObjectInputStream from which data is read

Annotations
@Serial
Exceptions
IOException:
if an I/O error occurs
ClassNotFoundException:
if a serialized class cannot be loaded
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string describing this code signer.

Returns:String

A string comprising the signer's certificate and a timestamp, if present.