/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package java.security.cert; import java.io.ByteArrayInputStream; import java.math.BigInteger; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.Principal; import java.security.PublicKey; import java.security.SignatureException; import java.security.cert.CRL; import java.security.cert.CRLException; import java.security.cert.X509CRLEntry; import java.security.cert.X509Extension; import java.util.Arrays; import java.util.Date; import java.util.Set; import javax.security.auth.x500.X500Principal; import org.apache.harmony.security.internal.nls.Messages; /** * Abstract base class for X.509 certificate revocation lists (CRL). *
* More information regarding CRL can be found in RFC 2459,
* "Internet X.509 Public Key Infrastructure Certificate and CRL Profile" at http://www.ietf.org/rfc/rfc2459.txt
* .
*/
public abstract class X509CRL extends CRL implements X509Extension {
/**
* Creates a new {@code X509CRL} instance.
*/
protected X509CRL() {
super("X.509"); //$NON-NLS-1$
}
/**
* Returns whether the specified object equals to this instance.
*
* @param other
* the object to compare.
* @return {@code true} if the specified object is equal to this, otherwise
* {@code false}.
*/
public boolean equals(Object other) {
if (other == this) {
return true;
}
if (!(other instanceof X509CRL)) {
return false;
}
X509CRL obj = (X509CRL) other;
try {
return Arrays.equals(getEncoded(), obj.getEncoded());
} catch (CRLException e) {
return false;
}
}
/**
* Returns the hashcode of this CRL instance.
*
* @return the hashcode.
*/
public int hashCode() {
try {
int res = 0;
byte[] array = getEncoded();
for (int i=0; i