CodeSigner
Stay organized with collections
Save and categorize content based on your preferences.
This class encapsulates information about a code signer.
It is immutable.
Public Constructor Summary
Inherited Method Summary
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals( Object obj)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait(long timeout, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long timeout)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
Public Constructors
public
CodeSigner
(CertPath signerCertPath, 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. |
Public Methods
public
boolean
equals
(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.
Parameters
obj |
the object to test for equality with this object. |
Returns
- true if the objects are considered equal, false otherwise.
public
CertPath
getSignerCertPath
()
Returns the signer's certificate path.
public
Timestamp
getTimestamp
()
Returns the signature timestamp.
Returns
- The timestamp or
null
if none is present.
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.
Returns
- a hash code value for this code signer.
public
String
toString
()
Returns a string describing this code signer.
Returns
- A string comprising the signer's certificate and a timestamp,
if present.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eCodeSigner\u003c/code\u003e class in Java encapsulates information about a code signer, including their certificate path and optional timestamp.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to access the signer's certificate path and timestamp, as well as methods for equality comparison and hash code generation.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCodeSigner\u003c/code\u003e objects are immutable, meaning their state cannot be changed after creation.\u003c/p\u003e\n"],["\u003cp\u003eInstances of \u003ccode\u003eCodeSigner\u003c/code\u003e are created using a constructor that takes the signer's certificate path and an optional timestamp.\u003c/p\u003e\n"]]],["The `CodeSigner` class encapsulates code signer information, utilizing a certificate path and an optional timestamp. It offers methods to construct a `CodeSigner` object, providing the signer's `CertPath` and `Timestamp`. Key actions include retrieving the `CertPath` via `getSignerCertPath()`, obtaining the `Timestamp` using `getTimestamp()`, and checking object equality with `equals()`. The `hashCode()` method generates a hash code, and `toString()` returns a string description. `CodeSigner` is immutable and implements `Serializable`.\n"],null,["public final class **CodeSigner** extends [Object](../../../reference/java/lang/Object.html) \nimplements [Serializable](../../../reference/java/io/Serializable.html) \nThis class encapsulates information about a code signer.\nIt is immutable. \n\nPublic Constructor Summary\n\n|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [CodeSigner](../../../reference/java/security/CodeSigner.html#CodeSigner(java.security.cert.CertPath,%20java.security.Timestamp))([CertPath](../../../reference/java/security/cert/CertPath.html) signerCertPath, [Timestamp](../../../reference/java/security/Timestamp.html) timestamp) Constructs a CodeSigner object. |\n\nPublic Method Summary\n\n|-----------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](../../../reference/java/security/CodeSigner.html#equals(java.lang.Object))([Object](../../../reference/java/lang/Object.html) obj) Tests for equality between the specified object and this code signer. |\n| [CertPath](../../../reference/java/security/cert/CertPath.html) | [getSignerCertPath](../../../reference/java/security/CodeSigner.html#getSignerCertPath())() Returns the signer's certificate path. |\n| [Timestamp](../../../reference/java/security/Timestamp.html) | [getTimestamp](../../../reference/java/security/CodeSigner.html#getTimestamp())() Returns the signature timestamp. |\n| int | [hashCode](../../../reference/java/security/CodeSigner.html#hashCode())() Returns the hash code value for this code signer. |\n| [String](../../../reference/java/lang/String.html) | [toString](../../../reference/java/security/CodeSigner.html#toString())() Returns a string describing this code signer. |\n\nInherited Method Summary \nFrom class [java.lang.Object](../../../reference/java/lang/Object.html) \n\n|-------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Object](../../../reference/java/lang/Object.html) | [clone](../../../reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |\n| boolean | [equals](../../../reference/java/lang/Object.html#equals(java.lang.Object))([Object](../../../reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |\n| void | [finalize](../../../reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |\n| final [Class](../../../reference/java/lang/Class.html)\\\u003c?\\\u003e | [getClass](../../../reference/java/lang/Object.html#getClass())() Returns the unique instance of [Class](../../../reference/java/lang/Class.html) that represents this object's class. |\n| int | [hashCode](../../../reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |\n| final void | [notify](../../../reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |\n| final void | [notifyAll](../../../reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |\n| [String](../../../reference/java/lang/String.html) | [toString](../../../reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |\n| final void | [wait](../../../reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |\n| final void | [wait](../../../reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |\n| final void | [wait](../../../reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |\n\nPublic Constructors \n\npublic\n**CodeSigner**\n([CertPath](../../../reference/java/security/cert/CertPath.html) signerCertPath, [Timestamp](../../../reference/java/security/Timestamp.html) timestamp) \nConstructs a CodeSigner object. \n\nParameters\n\n| signerCertPath | The signer's certificate path. It must not be `null`. |\n| timestamp | A signature timestamp. If `null` then no timestamp was generated for the signature. |\n|----------------|-------------------------------------------------------------------------------------|\n\nThrows\n\n| [NullPointerException](../../../reference/java/lang/NullPointerException.html) | if `signerCertPath` is `null`. |\n|--------------------------------------------------------------------------------|--------------------------------|\n\nPublic Methods \n\npublic boolean\n**equals**\n([Object](../../../reference/java/lang/Object.html) obj) \nTests for equality between the specified object and this\ncode signer. Two code signers are considered equal if their\nsigner certificate paths are equal and if their timestamps are equal,\nif present in both. \n\nParameters\n\n| obj | the object to test for equality with this object. |\n|-----|---------------------------------------------------|\n\nReturns\n\n- true if the objects are considered equal, false otherwise. \n\npublic [CertPath](../../../reference/java/security/cert/CertPath.html)\n**getSignerCertPath**\n() \nReturns the signer's certificate path. \n\nReturns\n\n- A certificate path. \n\npublic [Timestamp](../../../reference/java/security/Timestamp.html)\n**getTimestamp**\n() \nReturns the signature timestamp. \n\nReturns\n\n- The timestamp or `null` if none is present. \n\npublic int\n**hashCode**\n() \nReturns the hash code value for this code signer.\nThe hash code is generated using the signer's certificate path and the\ntimestamp, if present. \n\nReturns\n\n- a hash code value for this code signer. \n\npublic [String](../../../reference/java/lang/String.html)\n**toString**\n() \nReturns a string describing this code signer. \n\nReturns\n\n- A string comprising the signer's certificate and a timestamp, if present."]]