< prev index next >

src/java.base/share/classes/java/security/cert/CertPathValidator.java

Print this page




 296      * Returns the default {@code CertPathValidator} type as specified by
 297      * the {@code certpathvalidator.type} security property, or the string
 298      * {@literal "PKIX"} if no such property exists.
 299      *
 300      * <p>The default {@code CertPathValidator} type can be used by
 301      * applications that do not want to use a hard-coded type when calling one
 302      * of the {@code getInstance} methods, and want to provide a default
 303      * type in case a user does not specify its own.
 304      *
 305      * <p>The default {@code CertPathValidator} type can be changed by
 306      * setting the value of the {@code certpathvalidator.type} security
 307      * property to the desired type.
 308      *
 309      * @see java.security.Security security properties
 310      * @return the default {@code CertPathValidator} type as specified
 311      * by the {@code certpathvalidator.type} security property, or the string
 312      * {@literal "PKIX"} if no such property exists.
 313      */
 314     public final static String getDefaultType() {
 315         String cpvtype =
 316             AccessController.doPrivileged(new PrivilegedAction<String>() {
 317                 public String run() {
 318                     return Security.getProperty(CPV_TYPE);
 319                 }
 320             });
 321         return (cpvtype == null) ? "PKIX" : cpvtype;
 322     }
 323 
 324     /**
 325      * Returns a {@code CertPathChecker} that the encapsulated
 326      * {@code CertPathValidatorSpi} implementation uses to check the revocation
 327      * status of certificates. A PKIX implementation returns objects of
 328      * type {@code PKIXRevocationChecker}. Each invocation of this method
 329      * returns a new instance of {@code CertPathChecker}.
 330      *
 331      * <p>The primary purpose of this method is to allow callers to specify
 332      * additional input parameters and options specific to revocation checking.
 333      * See the class description for an example.
 334      *
 335      * @return a {@code CertPathChecker}
 336      * @throws UnsupportedOperationException if the service provider does not


 296      * Returns the default {@code CertPathValidator} type as specified by
 297      * the {@code certpathvalidator.type} security property, or the string
 298      * {@literal "PKIX"} if no such property exists.
 299      *
 300      * <p>The default {@code CertPathValidator} type can be used by
 301      * applications that do not want to use a hard-coded type when calling one
 302      * of the {@code getInstance} methods, and want to provide a default
 303      * type in case a user does not specify its own.
 304      *
 305      * <p>The default {@code CertPathValidator} type can be changed by
 306      * setting the value of the {@code certpathvalidator.type} security
 307      * property to the desired type.
 308      *
 309      * @see java.security.Security security properties
 310      * @return the default {@code CertPathValidator} type as specified
 311      * by the {@code certpathvalidator.type} security property, or the string
 312      * {@literal "PKIX"} if no such property exists.
 313      */
 314     public final static String getDefaultType() {
 315         String cpvtype =
 316             AccessController.doPrivileged(new PrivilegedAction<>() {
 317                 public String run() {
 318                     return Security.getProperty(CPV_TYPE);
 319                 }
 320             });
 321         return (cpvtype == null) ? "PKIX" : cpvtype;
 322     }
 323 
 324     /**
 325      * Returns a {@code CertPathChecker} that the encapsulated
 326      * {@code CertPathValidatorSpi} implementation uses to check the revocation
 327      * status of certificates. A PKIX implementation returns objects of
 328      * type {@code PKIXRevocationChecker}. Each invocation of this method
 329      * returns a new instance of {@code CertPathChecker}.
 330      *
 331      * <p>The primary purpose of this method is to allow callers to specify
 332      * additional input parameters and options specific to revocation checking.
 333      * See the class description for an example.
 334      *
 335      * @return a {@code CertPathChecker}
 336      * @throws UnsupportedOperationException if the service provider does not
< prev index next >