/*
* 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.
*/
/**
* This class defines the CRL Extensions.
* It is used for both CRL Extensions and CRL Entry Extensions,
* which are defined are follows:
* <pre>
* TBSCertList ::= SEQUENCE {
* version Version OPTIONAL, -- if present, must be v2
* signature AlgorithmIdentifier,
* issuer Name,
* thisUpdate Time,
* nextUpdate Time OPTIONAL,
* revokedCertificates SEQUENCE OF SEQUENCE {
* userCertificate CertificateSerialNumber,
* revocationDate Time,
* crlEntryExtensions Extensions OPTIONAL -- if present, must be v2
* } OPTIONAL,
* crlExtensions [0] EXPLICIT Extensions OPTIONAL -- if present, must be v2
* }
* </pre>
*
* @author Hemma Prafullchandra
*/
public class CRLExtensions {
private boolean unsupportedCritExt = false;
/**
* Default constructor.
*/
public CRLExtensions() { }
/**
* Create the object, decoding the values from the passed DER stream.
*
* @param in the DerInputStream to read the Extension from, i.e. the
* sequence of extensions.
* @exception CRLException on decoding errors.
*/
}
// helper routine
try {
// check for context specific byte 0; skip it
}
}
} catch (IOException e) {
}
}
// Parse the encoded extension
try {
if (ext.isCritical())
unsupportedCritExt = true;
throw new CRLException("Duplicate extensions not allowed");
return;
}
ext.getExtensionValue()};
throw new CRLException("Duplicate extensions not allowed");
}
} catch (InvocationTargetException invk) {
} catch (Exception e) {
throw new CRLException(e.toString());
}
}
/**
* Encode the extensions in DER form to the stream.
*
* @param out the DerOutputStream to marshal the contents to.
* @param isExplicit the tag indicating whether this is an entry
* extension (false) or a CRL extension (true).
* @exception CRLException on encoding errors.
*/
throws CRLException {
try {
if (objs[i] instanceof CertAttrSet)
else
throw new CRLException("Illegal extension object");
}
if (isExplicit)
true, (byte)0), seq);
else
} catch (IOException e) {
} catch (CertificateException e) {
}
}
/**
* Get the extension with this alias.
*
* @param alias the identifier string for the extension to retrieve.
*/
} else
}
/**
* Set the extension value with this alias.
*
* @param alias the identifier string for the extension to set.
* @param obj the Object to set the extension identified by the
* alias.
*/
}
/**
* Delete the extension value with this alias.
*
* @param alias the identifier string for the extension to delete.
*/
}
/**
* Return an enumeration of the extensions.
* @return an enumeration of the extensions in this CRL.
*/
}
/**
* Return a collection view of the extensions.
* @return a collection view of the extensions in this CRL.
*/
}
/**
* Return true if a critical extension is found that is
* not supported, otherwise return false.
*/
public boolean hasUnsupportedCriticalExtension() {
return unsupportedCritExt;
}
/**
* Compares this CRLExtensions for equality with the specified
* object. If the <code>other</code> object is an
* <code>instanceof</code> <code>CRLExtensions</code>, then
* all the entries are compared with the entries from this.
*
* @param other the object to test for equality with this CRLExtensions.
* @return true iff all the entries match that of the Other,
* false otherwise.
*/
if (this == other)
return true;
if (!(other instanceof CRLExtensions))
return false;
return false;
for (int i = 0; i < len; i++) {
if (objs[i] instanceof CertAttrSet)
return false;
return false;
}
return true;
}
/**
* Returns a hashcode value for this CRLExtensions.
*
* @return the hashcode value.
*/
public int hashCode() {
}
/**
* Returns a string representation of this <tt>CRLExtensions</tt> object
* in the form of a set of entries, enclosed in braces and separated
* by the ASCII characters "<tt>, </tt>" (comma and space).
* <p>Overrides to <tt>toString</tt> method of <tt>Object</tt>.
*
* @return a string representation of this CRLExtensions.
*/
}
}