001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: /**
019: * @author Alexander Y. Kleymenov
020: * @version $Revision$
021: */package java.security.cert;
022:
023: import java.math.BigInteger;
024: import java.security.cert.CRLException;
025: import java.security.cert.X509CRLEntry;
026: import java.security.cert.X509Extension;
027: import java.util.Arrays;
028: import java.util.Date;
029: import javax.security.auth.x500.X500Principal;
030:
031: /**
032: * @com.intel.drl.spec_ref
033: */
034: public abstract class X509CRLEntry implements X509Extension {
035:
036: /**
037: * @com.intel.drl.spec_ref
038: */
039: public X509CRLEntry() {
040: }
041:
042: /**
043: * @com.intel.drl.spec_ref
044: */
045: public boolean equals(Object other) {
046: if (other == this ) {
047: return true;
048: }
049: if (!(other instanceof X509CRLEntry)) {
050: return false;
051: }
052: X509CRLEntry obj = (X509CRLEntry) other;
053: try {
054: return Arrays.equals(getEncoded(), obj.getEncoded());
055: } catch (CRLException e) {
056: return false;
057: }
058: }
059:
060: /**
061: * @com.intel.drl.spec_ref
062: */
063: public int hashCode() {
064: int res = 0;
065: try {
066: byte[] array = getEncoded();
067: for (int i = 0; i < array.length; i++) {
068: res += array[i] & 0xFF;
069: }
070: } catch (CRLException e) {
071: }
072: return res;
073: }
074:
075: /**
076: * @com.intel.drl.spec_ref
077: */
078: public abstract byte[] getEncoded() throws CRLException;
079:
080: /**
081: * @com.intel.drl.spec_ref
082: */
083: public abstract BigInteger getSerialNumber();
084:
085: public X500Principal getCertificateIssuer() {
086: return null;
087: }
088:
089: /**
090: * @com.intel.drl.spec_ref
091: */
092: public abstract Date getRevocationDate();
093:
094: /**
095: * @com.intel.drl.spec_ref
096: */
097: public abstract boolean hasExtensions();
098:
099: /**
100: * @com.intel.drl.spec_ref
101: */
102: public abstract String toString();
103: }
|