/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* BasicChecker is a PKIXCertPathChecker that checks the basic information
* name chaining.
*
* @since 1.4
* @author Yassir Elley
*/
private final boolean sigOnly;
/**
* Constructor that initializes the input parameters.
*
* @param anchor the anchor selected to validate the target certificate
* @param testDate the time for which the validity of the certificate
* should be determined
* @param sigProvider the name of the signature provider
* @param sigOnly true if only signature checking is to be done;
* if false, all checks are done
*/
boolean sigOnly) throws CertPathValidatorException
{
} else {
}
this.sigProvider = sigProvider;
init(false);
}
/**
* Initializes the internal state of the checker from parameters
* specified in the constructor.
*/
if (!forward) {
} else {
throw new
CertPathValidatorException("forward checking not supported");
}
}
public boolean isForwardCheckingSupported() {
return false;
}
return null;
}
/**
* checks on the certificate using its internal state. This method does
* not remove any critical extensions from the Collection.
*
* @param cert the Certificate
* @param unresolvedCritExts a Collection of the unresolved critical
* extensions
* @exception CertPathValidatorException Exception thrown if certificate
* does not verify.
*/
throws CertPathValidatorException
{
if (!sigOnly) {
}
}
/**
* Verifies the signature on the certificate using the previous public key
* @param cert the Certificate
* @param prevPubKey the previous PublicKey
* @param sigProvider a String containing the signature provider
* @exception CertPathValidatorException Exception thrown if certificate
* does not verify.
*/
{
try {
} catch (SignatureException e) {
throw new CertPathValidatorException
} catch (Exception e) {
}
}
/**
* Internal method to verify the timestamp on a certificate
*/
throws CertPathValidatorException
{
try {
} catch (CertificateExpiredException e) {
throw new CertPathValidatorException
} catch (CertificateNotYetValidException e) {
throw new CertPathValidatorException
}
}
/**
* Internal method to check that cert has a valid DN to be next in a chain
*/
{
if (prevSubject != null) {
// reject null or empty issuer DNs
throw new CertPathValidatorException
(msg + " check failed: " +
}
throw new CertPathValidatorException
}
}
}
/**
* Internal method to manage state information at each iteration
*/
throws CertPathValidatorException
{
}
if (cKey instanceof DSAPublicKey &&
//cKey needs to inherit DSA parameters from prev key
"key with inherited params");
}
prevPubKey = cKey;
}
/**
* Internal method to create a new key with inherited key parameters
*
* @param keyValueKey key from which to obtain key value
* @param keyParamsKey key from which to obtain key parameters
* @return new public key having value and parameters
* @throws CertPathValidatorException if keys are not appropriate types
* for this operation
*/
{
if (!(keyValueKey instanceof DSAPublicKey) ||
!(keyParamsKey instanceof DSAPublicKey))
throw new CertPathValidatorException("Input key is not " +
"appropriate type for " +
"inheriting parameters");
throw new CertPathValidatorException("Key parameters missing");
try {
} catch (GeneralSecurityException e) {
throw new CertPathValidatorException("Unable to generate key with" +
" inherited parameters: " +
e.getMessage(), e);
}
return usableKey;
}
/**
* return the public key associated with the last certificate processed
*
* @return PublicKey the last public key processed
*/
return prevPubKey;
}
}