src/share/classes/java/security/cert/CertPathValidatorException.java

Print this page




 199      */
 200     public CertPath getCertPath() {
 201         return this.certPath;
 202     }
 203 
 204     /**
 205      * Returns the index of the certificate in the certification path
 206      * that caused the exception to be thrown. Note that the list of
 207      * certificates in a <code>CertPath</code> is zero based. If no
 208      * index has been set, -1 is returned.
 209      *
 210      * @return the index that has been set, or -1 if none has been set
 211      */
 212     public int getIndex() {
 213         return this.index;
 214     }
 215 
 216     /**
 217      * Returns the reason that the validation failed. The reason is
 218      * associated with the index of the certificate returned by
 219      * {@link getIndex}.
 220      *
 221      * @return the reason that the validation failed, or
 222      *    <code>BasicReason.UNSPECIFIED</code> if a reason has not been
 223      *    specified
 224      *
 225      * @since 1.7
 226      */
 227     public Reason getReason() {
 228         return this.reason;
 229     }
 230 
 231     private void readObject(ObjectInputStream stream)
 232         throws ClassNotFoundException, IOException {
 233         stream.defaultReadObject();
 234         if (reason == null) {
 235             reason = BasicReason.UNSPECIFIED;
 236         }
 237         if (certPath == null && index != -1) {
 238             throw new InvalidObjectException("certpath is null and index != -1");
 239         }




 199      */
 200     public CertPath getCertPath() {
 201         return this.certPath;
 202     }
 203 
 204     /**
 205      * Returns the index of the certificate in the certification path
 206      * that caused the exception to be thrown. Note that the list of
 207      * certificates in a <code>CertPath</code> is zero based. If no
 208      * index has been set, -1 is returned.
 209      *
 210      * @return the index that has been set, or -1 if none has been set
 211      */
 212     public int getIndex() {
 213         return this.index;
 214     }
 215 
 216     /**
 217      * Returns the reason that the validation failed. The reason is
 218      * associated with the index of the certificate returned by
 219      * {@link #getIndex}.
 220      *
 221      * @return the reason that the validation failed, or
 222      *    <code>BasicReason.UNSPECIFIED</code> if a reason has not been
 223      *    specified
 224      *
 225      * @since 1.7
 226      */
 227     public Reason getReason() {
 228         return this.reason;
 229     }
 230 
 231     private void readObject(ObjectInputStream stream)
 232         throws ClassNotFoundException, IOException {
 233         stream.defaultReadObject();
 234         if (reason == null) {
 235             reason = BasicReason.UNSPECIFIED;
 236         }
 237         if (certPath == null && index != -1) {
 238             throw new InvalidObjectException("certpath is null and index != -1");
 239         }