9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* 25 * @test 26 * @author Weijun Wang 27 * @bug 4654195 28 * @summary BIT STRING types with named bits must remove trailing 0 bits 29 */ 30 31 import sun.security.util.BitArray; 32 import sun.security.util.DerOutputStream; 33 import sun.security.util.DerValue; 34 import sun.security.x509.DNSName; 35 import sun.security.x509.DistributionPoint; 36 import sun.security.x509.GeneralName; 37 import sun.security.x509.GeneralNames; 38 import sun.security.x509.KeyUsageExtension; 39 import sun.security.x509.NetscapeCertTypeExtension; 40 import sun.security.x509.ReasonFlags; 41 42 public class NamedBitList { 43 public static void main(String[] args) throws Exception { 44 45 boolean[] bb = (new boolean[] {true, false, true, false, false, false}); 46 GeneralNames gns = new GeneralNames(); 47 gns.add(new GeneralName(new DNSName("dns"))); 48 DerOutputStream out; | 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* 25 * @test 26 * @author Weijun Wang 27 * @bug 4654195 28 * @summary BIT STRING types with named bits must remove trailing 0 bits 29 * @modules java.base/sun.security.util 30 * java.base/sun.security.x509 31 */ 32 33 import sun.security.util.BitArray; 34 import sun.security.util.DerOutputStream; 35 import sun.security.util.DerValue; 36 import sun.security.x509.DNSName; 37 import sun.security.x509.DistributionPoint; 38 import sun.security.x509.GeneralName; 39 import sun.security.x509.GeneralNames; 40 import sun.security.x509.KeyUsageExtension; 41 import sun.security.x509.NetscapeCertTypeExtension; 42 import sun.security.x509.ReasonFlags; 43 44 public class NamedBitList { 45 public static void main(String[] args) throws Exception { 46 47 boolean[] bb = (new boolean[] {true, false, true, false, false, false}); 48 GeneralNames gns = new GeneralNames(); 49 gns.add(new GeneralName(new DNSName("dns"))); 50 DerOutputStream out; |