1561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes/*
2561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  Licensed to the Apache Software Foundation (ASF) under one or more
3561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  contributor license agreements.  See the NOTICE file distributed with
4561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  this work for additional information regarding copyright ownership.
5561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  The ASF licenses this file to You under the Apache License, Version 2.0
6561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  (the "License"); you may not use this file except in compliance with
7561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  the License.  You may obtain a copy of the License at
8561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *
9561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *     http://www.apache.org/licenses/LICENSE-2.0
10561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *
11561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  Unless required by applicable law or agreed to in writing, software
12561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  distributed under the License is distributed on an "AS IS" BASIS,
13561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  See the License for the specific language governing permissions and
15561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  limitations under the License.
16561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes */
17561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
18561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes/**
19561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes* @author Alexander Y. Kleymenov
20561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes*/
21561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
22561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughespackage org.apache.harmony.security.tests.provider.cert;
23561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
24561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughesimport java.io.ByteArrayInputStream;
25561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughesimport java.security.NoSuchProviderException;
26561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughesimport java.security.cert.CertificateFactory;
27561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughesimport java.security.cert.CertificateException;
28561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
29561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughesimport junit.framework.Test;
30561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughesimport junit.framework.TestCase;
31561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughesimport junit.framework.TestSuite;
32561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
33561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes/**
34561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes * DRLCertFactoryTest
35561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes */
36561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughespublic class DRLCertFactoryTest extends TestCase {
37561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
38e98fbf8686c5289bf03fe5c3de7ff82d3a77104dElliott Hughes    // The testing data was generated by using of classes
39561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    // from org.apache.harmony.security.asn1 package.
40561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
41561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    // 2 consecutively encoded X.509 certificates
42561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    private static byte[] certEncoding = new byte[] {
43561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x30,(byte) 0x82,(byte) 0x02,(byte) 0xfa,(byte) 0x30,
44561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x82,(byte) 0x02,(byte) 0xb6,(byte) 0xa0,(byte) 0x03,
45561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x02,(byte) 0x01,(byte) 0x02,(byte) 0x02,(byte) 0x02,
46561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x02,(byte) 0x2b,(byte) 0x30,(byte) 0x0c,(byte) 0x06,
47561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x07,(byte) 0x2a,(byte) 0x86,(byte) 0x48,(byte) 0xce,
48561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x38,(byte) 0x04,(byte) 0x03,(byte) 0x01,(byte) 0x01,
49561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x00,(byte) 0x30,(byte) 0x1d,(byte) 0x31,(byte) 0x1b,
50561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x30,(byte) 0x19,(byte) 0x06,(byte) 0x03,(byte) 0x55,
51561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x04,(byte) 0x0a,(byte) 0x13,(byte) 0x12,(byte) 0x43,
52561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x65,(byte) 0x72,(byte) 0x74,(byte) 0x69,(byte) 0x66,
53561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x69,(byte) 0x63,(byte) 0x61,(byte) 0x74,(byte) 0x65,
54561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x20,(byte) 0x49,(byte) 0x73,(byte) 0x73,(byte) 0x75,
55561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x65,(byte) 0x72,(byte) 0x30,(byte) 0x22,(byte) 0x18,
56561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x0f,(byte) 0x31,(byte) 0x39,(byte) 0x37,(byte) 0x30,
57561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x30,(byte) 0x31,(byte) 0x31,(byte) 0x32,(byte) 0x31,
58561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x33,(byte) 0x34,(byte) 0x36,(byte) 0x34,(byte) 0x30,
59561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x5a,(byte) 0x18,(byte) 0x0f,(byte) 0x31,(byte) 0x39,
60561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x37,(byte) 0x30,(byte) 0x30,(byte) 0x31,(byte) 0x32,
61561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x34,(byte) 0x30,(byte) 0x33,(byte) 0x33,(byte) 0x33,
62561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x32,(byte) 0x30,(byte) 0x5a,(byte) 0x30,(byte) 0x1f,
63561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x31,(byte) 0x1d,(byte) 0x30,(byte) 0x1b,(byte) 0x06,
64561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x03,(byte) 0x55,(byte) 0x04,(byte) 0x0a,(byte) 0x13,
65561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x14,(byte) 0x53,(byte) 0x75,(byte) 0x62,(byte) 0x6a,
66561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x65,(byte) 0x63,(byte) 0x74,(byte) 0x20,(byte) 0x4f,
67561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x72,(byte) 0x67,(byte) 0x61,(byte) 0x6e,(byte) 0x69,
68561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x7a,(byte) 0x61,(byte) 0x74,(byte) 0x69,(byte) 0x6f,
69561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x6e,(byte) 0x30,(byte) 0x19,(byte) 0x30,(byte) 0x0c,
70561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x06,(byte) 0x07,(byte) 0x2a,(byte) 0x86,(byte) 0x48,
71561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0xce,(byte) 0x38,(byte) 0x04,(byte) 0x03,(byte) 0x01,
72561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x01,(byte) 0x00,(byte) 0x03,(byte) 0x09,(byte) 0x00,
73561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x01,(byte) 0x02,(byte) 0x03,(byte) 0x04,(byte) 0x05,
74561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x06,(byte) 0x07,(byte) 0x08,(byte) 0x81,(byte) 0x02,
75561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x00,(byte) 0xaa,(byte) 0x82,(byte) 0x02,(byte) 0x00,
76561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x55,(byte) 0xa3,(byte) 0x82,(byte) 0x02,(byte) 0x14,
77561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x30,(byte) 0x82,(byte) 0x02,(byte) 0x10,(byte) 0x30,
78561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x0f,(byte) 0x06,(byte) 0x03,(byte) 0x55,(byte) 0x1d,
79561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x0f,(byte) 0x01,(byte) 0x01,(byte) 0xff,(byte) 0x04,
80561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x05,(byte) 0x03,(byte) 0x03,(byte) 0x01,(byte) 0xaa,
81561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x80,(byte) 0x30,(byte) 0x12,(byte) 0x06,(byte) 0x03,
82561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x55,(byte) 0x1d,(byte) 0x13,(byte) 0x01,(byte) 0x01,
83561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0xff,(byte) 0x04,(byte) 0x08,(byte) 0x30,(byte) 0x06,
84561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x01,(byte) 0x01,(byte) 0xff,(byte) 0x02,(byte) 0x01,
85561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x05,(byte) 0x30,(byte) 0x14,(byte) 0x06,(byte) 0x03,
86561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x55,(byte) 0x1d,(byte) 0x20,(byte) 0x01,(byte) 0x01,
87561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0xff,(byte) 0x04,(byte) 0x0a,(byte) 0x30,(byte) 0x08,
88561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x30,(byte) 0x06,(byte) 0x06,(byte) 0x04,(byte) 0x55,
89561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x1d,(byte) 0x20,(byte) 0x00,(byte) 0x30,(byte) 0x67,
90561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x06,(byte) 0x03,(byte) 0x55,(byte) 0x1d,(byte) 0x11,
91561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x01,(byte) 0x01,(byte) 0xff,(byte) 0x04,(byte) 0x5d,
92561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x30,(byte) 0x5b,(byte) 0x81,(byte) 0x0c,(byte) 0x72,
93561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x66,(byte) 0x63,(byte) 0x40,(byte) 0x38,(byte) 0x32,
94561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x32,(byte) 0x2e,(byte) 0x4e,(byte) 0x61,(byte) 0x6d,
95561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x65,(byte) 0x82,(byte) 0x07,(byte) 0x64,(byte) 0x4e,
96561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x53,(byte) 0x4e,(byte) 0x61,(byte) 0x6d,(byte) 0x65,
97561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0xa4,(byte) 0x17,(byte) 0x31,(byte) 0x15,(byte) 0x30,
98561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x13,(byte) 0x06,(byte) 0x03,(byte) 0x55,(byte) 0x04,
99561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x0a,(byte) 0x13,(byte) 0x0c,(byte) 0x4f,(byte) 0x72,
100561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x67,(byte) 0x61,(byte) 0x6e,(byte) 0x69,(byte) 0x7a,
101561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x61,(byte) 0x74,(byte) 0x69,(byte) 0x6f,(byte) 0x6e,
102561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x86,(byte) 0x1a,(byte) 0x68,(byte) 0x74,(byte) 0x74,
103561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x70,(byte) 0x3a,(byte) 0x2f,(byte) 0x2f,(byte) 0x75,
104561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x6e,(byte) 0x69,(byte) 0x66,(byte) 0x6f,(byte) 0x72,
105561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x6d,(byte) 0x2e,(byte) 0x52,(byte) 0x65,(byte) 0x73,
106561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x6f,(byte) 0x75,(byte) 0x72,(byte) 0x63,(byte) 0x65,
107561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x2e,(byte) 0x49,(byte) 0x64,(byte) 0x87,(byte) 0x04,
108561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0xff,(byte) 0xff,(byte) 0xff,(byte) 0x00,(byte) 0x88,
109561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x07,(byte) 0x2a,(byte) 0x03,(byte) 0xa2,(byte) 0x5c,
110561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x83,(byte) 0xb2,(byte) 0x03,(byte) 0x30,(byte) 0x0c,
111561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x06,(byte) 0x03,(byte) 0x55,(byte) 0x1d,(byte) 0x1e,
112561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x01,(byte) 0x01,(byte) 0xff,(byte) 0x04,(byte) 0x02,
113561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x30,(byte) 0x00,(byte) 0x30,(byte) 0x0c,(byte) 0x06,
114561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x03,(byte) 0x55,(byte) 0x1d,(byte) 0x24,(byte) 0x01,
115561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x01,(byte) 0xff,(byte) 0x04,(byte) 0x02,(byte) 0x30,
116561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x00,(byte) 0x30,(byte) 0x81,(byte) 0x99,(byte) 0x06,
117561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x03,(byte) 0x55,(byte) 0x1d,(byte) 0x25,(byte) 0x01,
118561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x01,(byte) 0xff,(byte) 0x04,(byte) 0x81,(byte) 0x8e,
119561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x30,(byte) 0x81,(byte) 0x8b,(byte) 0x06,(byte) 0x04,
120561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x55,(byte) 0x1d,(byte) 0x25,(byte) 0x00,(byte) 0x06,
121561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x08,(byte) 0x2b,(byte) 0x06,(byte) 0x01,(byte) 0x05,
122561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x05,(byte) 0x07,(byte) 0x03,(byte) 0x01,(byte) 0x06,
123561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x08,(byte) 0x2b,(byte) 0x06,(byte) 0x01,(byte) 0x05,
124561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x05,(byte) 0x07,(byte) 0x03,(byte) 0x01,(byte) 0x06,
125561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x08,(byte) 0x2b,(byte) 0x06,(byte) 0x01,(byte) 0x05,
126561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x05,(byte) 0x07,(byte) 0x03,(byte) 0x02,(byte) 0x06,
127561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x08,(byte) 0x2b,(byte) 0x06,(byte) 0x01,(byte) 0x05,
128561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x05,(byte) 0x07,(byte) 0x03,(byte) 0x03,(byte) 0x06,
129561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x08,(byte) 0x2b,(byte) 0x06,(byte) 0x01,(byte) 0x05,
130561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x05,(byte) 0x07,(byte) 0x03,(byte) 0x04,(byte) 0x06,
131561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x08,(byte) 0x2b,(byte) 0x06,(byte) 0x01,(byte) 0x05,
132561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x05,(byte) 0x07,(byte) 0x03,(byte) 0x05,(byte) 0x06,
133561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x08,(byte) 0x2b,(byte) 0x06,(byte) 0x01,(byte) 0x05,
134561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x05,(byte) 0x07,(byte) 0x03,(byte) 0x06,(byte) 0x06,
135561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x08,(byte) 0x2b,(byte) 0x06,(byte) 0x01,(byte) 0x05,
136561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x05,(byte) 0x07,(byte) 0x03,(byte) 0x07,(byte) 0x06,
137561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x08,(byte) 0x2b,(byte) 0x06,(byte) 0x01,(byte) 0x05,
138561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x05,(byte) 0x07,(byte) 0x03,(byte) 0x08,(byte) 0x06,
139561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x08,(byte) 0x2b,(byte) 0x06,(byte) 0x01,(byte) 0x05,
140561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x05,(byte) 0x07,(byte) 0x03,(byte) 0x09,(byte) 0x06,
141561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x08,(byte) 0x2b,(byte) 0x06,(byte) 0x01,(byte) 0x05,
142561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x05,(byte) 0x08,(byte) 0x02,(byte) 0x02,(byte) 0x06,
143561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x0a,(byte) 0x2b,(byte) 0x06,(byte) 0x01,(byte) 0x04,
144561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x01,(byte) 0x82,(byte) 0x37,(byte) 0x0a,(byte) 0x03,
145561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x03,(byte) 0x06,(byte) 0x09,(byte) 0x60,(byte) 0x86,
146561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x48,(byte) 0x01,(byte) 0x86,(byte) 0xf8,(byte) 0x42,
147561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x04,(byte) 0x01,(byte) 0x30,(byte) 0x0d,(byte) 0x06,
148561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x03,(byte) 0x55,(byte) 0x1d,(byte) 0x36,(byte) 0x01,
149561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x01,(byte) 0xff,(byte) 0x04,(byte) 0x03,(byte) 0x02,
150561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x01,(byte) 0x01,(byte) 0x30,(byte) 0x0e,(byte) 0x06,
151561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x04,(byte) 0x2a,(byte) 0x4d,(byte) 0x86,(byte) 0x09,
152561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x01,(byte) 0x01,(byte) 0xff,(byte) 0x04,(byte) 0x03,
153561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x01,(byte) 0x01,(byte) 0x01,(byte) 0x30,(byte) 0x64,
154561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x06,(byte) 0x03,(byte) 0x55,(byte) 0x1d,(byte) 0x12,
155561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x04,(byte) 0x5d,(byte) 0x30,(byte) 0x5b,(byte) 0x81,
156561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x0c,(byte) 0x72,(byte) 0x66,(byte) 0x63,(byte) 0x40,
157561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x38,(byte) 0x32,(byte) 0x32,(byte) 0x2e,(byte) 0x4e,
158561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x61,(byte) 0x6d,(byte) 0x65,(byte) 0x82,(byte) 0x07,
159561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x64,(byte) 0x4e,(byte) 0x53,(byte) 0x4e,(byte) 0x61,
160561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x6d,(byte) 0x65,(byte) 0xa4,(byte) 0x17,(byte) 0x31,
161561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x15,(byte) 0x30,(byte) 0x13,(byte) 0x06,(byte) 0x03,
162561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x55,(byte) 0x04,(byte) 0x0a,(byte) 0x13,(byte) 0x0c,
163561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x4f,(byte) 0x72,(byte) 0x67,(byte) 0x61,(byte) 0x6e,
164561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x69,(byte) 0x7a,(byte) 0x61,(byte) 0x74,(byte) 0x69,
165561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x6f,(byte) 0x6e,(byte) 0x86,(byte) 0x1a,(byte) 0x68,
166561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x74,(byte) 0x74,(byte) 0x70,(byte) 0x3a,(byte) 0x2f,
167561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x2f,(byte) 0x75,(byte) 0x6e,(byte) 0x69,(byte) 0x66,
168561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x6f,(byte) 0x72,(byte) 0x6d,(byte) 0x2e,(byte) 0x52,
169561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x65,(byte) 0x73,(byte) 0x6f,(byte) 0x75,(byte) 0x72,
170561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x63,(byte) 0x65,(byte) 0x2e,(byte) 0x49,(byte) 0x64,
171561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x87,(byte) 0x04,(byte) 0xff,(byte) 0xff,(byte) 0xff,
172561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x00,(byte) 0x88,(byte) 0x07,(byte) 0x2a,(byte) 0x03,
173561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0xa2,(byte) 0x5c,(byte) 0x83,(byte) 0xb2,(byte) 0x03,
174561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x30,(byte) 0x09,(byte) 0x06,(byte) 0x03,(byte) 0x55,
175561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x1d,(byte) 0x1f,(byte) 0x04,(byte) 0x02,(byte) 0x30,
176561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x00,(byte) 0x30,(byte) 0x0a,(byte) 0x06,(byte) 0x03,
177561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x55,(byte) 0x1d,(byte) 0x23,(byte) 0x04,(byte) 0x03,
178561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x01,(byte) 0x01,(byte) 0x01,(byte) 0x30,(byte) 0x0a,
179561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x06,(byte) 0x03,(byte) 0x55,(byte) 0x1d,(byte) 0x0e,
180561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x04,(byte) 0x03,(byte) 0x01,(byte) 0x01,(byte) 0x01,
181561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x30,(byte) 0x0a,(byte) 0x06,(byte) 0x03,(byte) 0x55,
182561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x1d,(byte) 0x21,(byte) 0x04,(byte) 0x03,(byte) 0x01,
183561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x01,(byte) 0x01,(byte) 0x30,(byte) 0x0c,(byte) 0x06,
184561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x07,(byte) 0x2a,(byte) 0x86,(byte) 0x48,(byte) 0xce,
185561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x38,(byte) 0x04,(byte) 0x03,(byte) 0x01,(byte) 0x01,
186561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x00,(byte) 0x03,(byte) 0x30,(byte) 0x00,(byte) 0x30,
187561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x2d,(byte) 0x02,(byte) 0x14,(byte) 0x00,(byte) 0xbe,
188561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x10,(byte) 0xbe,(byte) 0x86,(byte) 0xb3,(byte) 0x35,
189561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x63,(byte) 0xfb,(byte) 0x8e,(byte) 0xb8,(byte) 0xfc,
190561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0xe3,(byte) 0xf1,(byte) 0x99,(byte) 0x96,(byte) 0x19,
191561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0xb4,(byte) 0xf4,(byte) 0x3b,(byte) 0x02,(byte) 0x15,
192561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x00,(byte) 0x81,(byte) 0x28,(byte) 0x62,(byte) 0x82,
193561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x19,(byte) 0xba,(byte) 0xcf,(byte) 0xeb,(byte) 0x85,
194561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x6d,(byte) 0x52,(byte) 0xde,(byte) 0x09,(byte) 0x3e,
195561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x62,(byte) 0xe3,(byte) 0x5b,(byte) 0x55,(byte) 0x71,
196561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        (byte) 0x40,
197561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    };
198561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
199561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    /**
200561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes     * DRLCertFactory() method testing.
201561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes     */
202561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    public void testDRLCertFactory() {
203561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        CertificateFactory certFactory;
204561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        try {
205e98fbf8686c5289bf03fe5c3de7ff82d3a77104dElliott Hughes            certFactory =
206561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes                CertificateFactory.getInstance("X509", "DRLCertFactory");
207561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        } catch (CertificateException e) {
208561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            fail("X509 certificate type is not available: "+e.getMessage());
209561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            return;
210561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        } catch (NoSuchProviderException e) {
211561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            fail("Unexpected NoSuchProviderException: "+e.getMessage());
212561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            return;
213561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        }
214561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        // DER encoded certificate generation testing
215561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        ByteArrayInputStream bais = new ByteArrayInputStream(certEncoding);
216561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        try {
217e98fbf8686c5289bf03fe5c3de7ff82d3a77104dElliott Hughes            assertNotNull("Generated certificate is null",
218561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes                    certFactory.generateCertificate(bais));
219561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        } catch (CertificateException e) {
220561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            fail("Unexpected CertificateException: " + e.getMessage());
221561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        }
222e98fbf8686c5289bf03fe5c3de7ff82d3a77104dElliott Hughes
223561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        try {
224561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            certFactory.generateCertificate(bais);
225561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            fail("Expected CertificateException was not thrown.");
226561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        } catch (CertificateException e) {
227561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        }
228561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    }
229e98fbf8686c5289bf03fe5c3de7ff82d3a77104dElliott Hughes
230561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    public static Test suite() {
231561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        return new TestSuite(DRLCertFactoryTest.class);
232561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    }
233561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
234561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes}
235