1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
105 * @return the hashcode value.
106 */
107 public int hashCode() {
108 int retval = 0;
109 try {
110 byte[] entryData = this.getEncoded();
111 for (int i = 1; i < entryData.length; i++)
112 retval += entryData[i] * i;
113
114 } catch (CRLException ce) {
115 return(retval);
116 }
117 return(retval);
118 }
119
120 /**
121 * Returns the ASN.1 DER-encoded form of this CRL Entry,
122 * that is the inner SEQUENCE.
123 *
124 * @return the encoded form of this certificate
125 * @exception CRLException if an encoding error occurs.
126 */
127 public abstract byte[] getEncoded() throws CRLException;
128
129 /**
130 * Gets the serial number from this X509CRLEntry,
131 * the <em>userCertificate</em>.
132 *
133 * @return the serial number.
134 */
135 public abstract BigInteger getSerialNumber();
136
137 /**
138 * Get the issuer of the X509Certificate described by this entry. If
139 * the certificate issuer is also the CRL issuer, this method returns
140 * null.
141 *
142 * <p>This method is used with indirect CRLs. The default implementation
143 * always returns null. Subclasses that wish to support indirect CRLs
144 * should override it.
145 *
|
1 /*
2 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
105 * @return the hashcode value.
106 */
107 public int hashCode() {
108 int retval = 0;
109 try {
110 byte[] entryData = this.getEncoded();
111 for (int i = 1; i < entryData.length; i++)
112 retval += entryData[i] * i;
113
114 } catch (CRLException ce) {
115 return(retval);
116 }
117 return(retval);
118 }
119
120 /**
121 * Returns the ASN.1 DER-encoded form of this CRL Entry,
122 * that is the inner SEQUENCE.
123 *
124 * @return the encoded form of this certificate
125 * @throws CRLException if an encoding error occurs.
126 */
127 public abstract byte[] getEncoded() throws CRLException;
128
129 /**
130 * Gets the serial number from this X509CRLEntry,
131 * the <em>userCertificate</em>.
132 *
133 * @return the serial number.
134 */
135 public abstract BigInteger getSerialNumber();
136
137 /**
138 * Get the issuer of the X509Certificate described by this entry. If
139 * the certificate issuer is also the CRL issuer, this method returns
140 * null.
141 *
142 * <p>This method is used with indirect CRLs. The default implementation
143 * always returns null. Subclasses that wish to support indirect CRLs
144 * should override it.
145 *
|