unused += x;
}
value = new DERBitString(new byte[] { v }, unused);
} else if(r_oid.equals(new DERObjectIdentifier("2.5.29.17"))) { //subjectAltName
if(valuex.startsWith("DNS:")) {
value = new String(ByteList.plain(new GeneralNames(new GeneralName(GeneralName.dNSName,new DERIA5String(valuex.substring(4)))).getDEREncoded()));
} else if(valuex.startsWith("IP:")) {
String[] numbers = valuex.substring(3).split("\\.");
byte[] bs = new byte[4];
bs[0] = (byte) (Integer.parseInt(numbers[0]) & 0xff);
bs[1] = (byte) (Integer.parseInt(numbers[1]) & 0xff);
bs[2] = (byte) (Integer.parseInt(numbers[2]) & 0xff);
bs[3] = (byte) (Integer.parseInt(numbers[3]) & 0xff);
value = new String(ByteList.plain(new GeneralNames(new GeneralName(GeneralName.iPAddress,new DEROctetString(bs))).getDEREncoded()));
} else if(valuex.startsWith("IP Address:")) {
String[] numbers = valuex.substring(11).split("\\.");
byte[] bs = new byte[4];
bs[0] = (byte) (Integer.parseInt(numbers[0]) & 0xff);
bs[1] = (byte) (Integer.parseInt(numbers[1]) & 0xff);
bs[2] = (byte) (Integer.parseInt(numbers[2]) & 0xff);
bs[3] = (byte) (Integer.parseInt(numbers[3]) & 0xff);
value = new String(ByteList.plain(new GeneralNames(new GeneralName(GeneralName.iPAddress,new DEROctetString(bs))).getDEREncoded()));
}
} else if(r_oid.equals(new DERObjectIdentifier("2.5.29.37"))) { //extendedKeyUsage
String[] spl = valuex.split(", ?");
ASN1EncodableVector vector = new ASN1EncodableVector();
for(String name : spl) {