boolean[] subjectUniqueID = new boolean[]
{false, true, false, true, false, true, false, true}; // random value
// make the Extensions for TBSCertificate
// Subject Alternative Names
GeneralName[] san = new GeneralName[] {
new GeneralName(
new OtherName("1.2.3.4.5",
ASN1Integer.getInstance().encode(
BigInteger.valueOf(55L).toByteArray()))),
new GeneralName(1, "rfc@822.Name"),
new GeneralName(2, "dNSName"),
new GeneralName(new ORAddress()),
new GeneralName(4, "O=Organization"),
new GeneralName(new EDIPartyName("assigner","party")),
new GeneralName(6, "http://Resource.Id"),
new GeneralName(new byte[] {1, 1, 1, 1}),
new GeneralName(8, "1.2.3.4444.55555")
};
GeneralNames sans = new GeneralNames(Arrays.asList(san));
Extension extension = new Extension("2.5.29.17", true, sans.getEncoded());
Extensions extensions = new Extensions();
extensions.addExtension(extension);