Example usage for java.security.cert PKIXCertPathChecker PKIXCertPathChecker

List of usage examples for java.security.cert PKIXCertPathChecker PKIXCertPathChecker

Introduction

In this page you can find the example usage for java.security.cert PKIXCertPathChecker PKIXCertPathChecker.

Prototype

protected PKIXCertPathChecker() 

Source Link

Document

Default constructor.

Usage

From source file:Main.java

/**
 * Creates stub implementation of the <code>PKIXCertPathChecker</code>
 *
 * @return Stub implementation of the <code>PKIXCertPathChecker</code>
 *///w  w  w .  j  av  a2  s. c  o  m
public static PKIXCertPathChecker getTestCertPathChecker() {
    // stub implementation for testing purposes only
    return new PKIXCertPathChecker() {
        private boolean forward = false;

        @SuppressWarnings({ "unused", "unchecked" })
        public void check(Certificate arg0, Collection arg1) throws CertPathValidatorException {
        }

        public Set<String> getSupportedExtensions() {
            return null;
        }

        @SuppressWarnings("unused")
        public void init(boolean arg0) throws CertPathValidatorException {
            forward = arg0;
        }

        public boolean isForwardCheckingSupported() {
            // just to check this checker state
            return forward;
        }
    };
}