0N/A/*
2362N/A * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage sun.security.x509;
0N/A
0N/Aimport java.io.IOException;
0N/Aimport java.io.OutputStream;
0N/Aimport java.math.BigInteger;
0N/Aimport java.util.Enumeration;
0N/A
0N/Aimport sun.security.util.*;
0N/A
0N/A/**
0N/A * Represents the Delta CRL Indicator Extension.
0N/A *
0N/A * <p>
0N/A * The extension identifies a CRL as being a delta CRL.
0N/A * Delta CRLs contain updates to revocation information previously distributed,
0N/A * rather than all the information that would appear in a complete CRL.
0N/A * The extension contains a CRL number that identifies the CRL, complete for a
0N/A * given scope, that was used as the starting point in the generation of
0N/A * this delta CRL.
0N/A *
0N/A * <p>
0N/A * The extension is defined in Section 5.2.4 of
0N/A * <a href="http://www.ietf.org/rfc/rfc3280.txt">Internet X.509 PKI Certific
0N/Aate and Certificate Revocation List (CRL) Profile</a>.
0N/A *
0N/A * <p>
0N/A * Its ASN.1 definition is as follows:
0N/A * <pre>
0N/A * id-ce-deltaCRLIndicator OBJECT IDENTIFIER ::= { id-ce 27 }
0N/A *
0N/A * BaseCRLNumber ::= CRLNumber
0N/A * CRLNumber ::= INTEGER (0..MAX)
0N/A * </pre>
0N/A *
0N/A * @since 1.6
0N/A */
0N/Apublic class DeltaCRLIndicatorExtension extends CRLNumberExtension {
0N/A
0N/A /**
0N/A * Attribute name.
0N/A */
0N/A public static final String NAME = "DeltaCRLIndicator";
0N/A
0N/A private static final String LABEL = "Base CRL Number";
0N/A
0N/A /**
0N/A * Creates a delta CRL indicator extension with the integer value .
0N/A * The criticality is set to true.
0N/A *
0N/A * @param crlNum the value to be set for the extension.
0N/A */
0N/A public DeltaCRLIndicatorExtension(int crlNum) throws IOException {
0N/A super(PKIXExtensions.DeltaCRLIndicator_Id, true,
0N/A BigInteger.valueOf(crlNum), NAME, LABEL);
0N/A }
0N/A
0N/A /**
0N/A * Creates a delta CRL indictor extension with the BigInteger value .
0N/A * The criticality is set to true.
0N/A *
0N/A * @param crlNum the value to be set for the extension.
0N/A */
0N/A public DeltaCRLIndicatorExtension(BigInteger crlNum) throws IOException {
0N/A super(PKIXExtensions.DeltaCRLIndicator_Id, true, crlNum, NAME, LABEL);
0N/A }
0N/A
0N/A /**
0N/A * Creates the extension from the passed DER encoded value of the same.
0N/A *
0N/A * @param critical true if the extension is to be treated as critical.
0N/A * @param value an array of DER encoded bytes of the actual value.
0N/A * @exception ClassCastException if value is not an array of bytes
0N/A * @exception IOException on decoding error.
0N/A */
0N/A public DeltaCRLIndicatorExtension(Boolean critical, Object value)
0N/A throws IOException {
0N/A super(PKIXExtensions.DeltaCRLIndicator_Id, critical.booleanValue(),
0N/A value, NAME, LABEL);
0N/A }
0N/A
0N/A /**
0N/A * Writes the extension to the DerOutputStream.
0N/A *
0N/A * @param out the DerOutputStream to write the extension to.
0N/A * @exception IOException on encoding errors.
0N/A */
0N/A public void encode(OutputStream out) throws IOException {
0N/A DerOutputStream tmp = new DerOutputStream();
0N/A super.encode(out, PKIXExtensions.DeltaCRLIndicator_Id, true);
0N/A }
0N/A}