Path: blob/master/src/java.base/share/classes/sun/security/x509/FreshestCRLExtension.java
41159 views
/*1* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.security.x509;2627import java.io.IOException;28import java.io.OutputStream;29import java.math.BigInteger;30import java.util.Enumeration;31import java.util.List;3233import sun.security.util.*;3435/**36* Represents the Freshest CRL Extension.37*38* <p>39* The extension identifies how delta CRL information for a40* complete CRL is obtained.41*42* <p>43* The extension is defined in Section 5.2.6 of44* <a href="http://tools.ietf.org/html/rfc5280">Internet X.509 PKI45* Certificate and Certificate Revocation List (CRL) Profile</a>.46*47* <p>48* Its ASN.1 definition is as follows:49* <pre>50* id-ce-freshestCRL OBJECT IDENTIFIER ::= { id-ce 46 }51*52* FreshestCRL ::= CRLDistributionPoints53* </pre>54*55* @since 1.656*/57public class FreshestCRLExtension extends CRLDistributionPointsExtension {5859/**60* Attribute name.61*/62public static final String NAME = "FreshestCRL";6364/**65* Creates a freshest CRL extension.66* The criticality is set to false.67*68* @param distributionPoints the list of delta CRL distribution points.69*/70public FreshestCRLExtension(List<DistributionPoint> distributionPoints)71throws IOException {7273super(PKIXExtensions.FreshestCRL_Id, false, distributionPoints, NAME);74}7576/**77* Creates the extension from the passed DER encoded value of the same.78*79* @param critical true if the extension is to be treated as critical.80* @param value an array of DER encoded bytes of the actual value.81* @exception IOException on decoding error.82*/83public FreshestCRLExtension(Boolean critical, Object value)84throws IOException {85super(PKIXExtensions.FreshestCRL_Id, critical.booleanValue(), value,86NAME);87}8889/**90* Writes the extension to the DerOutputStream.91*92* @param out the DerOutputStream to write the extension to.93* @exception IOException on encoding errors.94*/95public void encode(OutputStream out) throws IOException {96super.encode(out, PKIXExtensions.FreshestCRL_Id, false);97}98}99100101