private void checkConstruction( ProfessionInfo profInfo, NamingAuthority auth, DirectoryString[] professionItems, ASN1ObjectIdentifier[] professionOids, String registrationNumber, DEROctetString addProfInfo) throws IOException { checkValues(profInfo, auth, professionItems, professionOids, registrationNumber, addProfInfo); profInfo = ProfessionInfo.getInstance(profInfo); checkValues(profInfo, auth, professionItems, professionOids, registrationNumber, addProfInfo); ASN1InputStream aIn = new ASN1InputStream(profInfo.toASN1Primitive().getEncoded()); ASN1Sequence seq = (ASN1Sequence)aIn.readObject(); profInfo = ProfessionInfo.getInstance(seq); checkValues(profInfo, auth, professionItems, professionOids, registrationNumber, addProfInfo); }
private void checkValues( ProfessionInfo profInfo, NamingAuthority auth, DirectoryString[] professionItems, ASN1ObjectIdentifier[] professionOids, String registrationNumber, DEROctetString addProfInfo) { checkOptionalField("auth", auth, profInfo.getNamingAuthority()); checkMandatoryField("professionItems", professionItems[0], profInfo.getProfessionItems()[0]); if (professionOids != null) { checkOptionalField("professionOids", professionOids[0], profInfo.getProfessionOIDs()[0]); } checkOptionalField("registrationNumber", registrationNumber, profInfo.getRegistrationNumber()); checkOptionalField("addProfessionInfo", addProfInfo, profInfo.getAddProfessionInfo()); }
private void checkConstruction( ProfessionInfo profInfo, NamingAuthority auth, DirectoryString[] professionItems, DERObjectIdentifier[] professionOids, String registrationNumber, DEROctetString addProfInfo) throws IOException { checkValues(profInfo, auth, professionItems, professionOids, registrationNumber, addProfInfo); profInfo = ProfessionInfo.getInstance(profInfo); checkValues(profInfo, auth, professionItems, professionOids, registrationNumber, addProfInfo); ASN1InputStream aIn = new ASN1InputStream(profInfo.toASN1Object().getEncoded()); ASN1Sequence seq = (ASN1Sequence)aIn.readObject(); profInfo = ProfessionInfo.getInstance(seq); checkValues(profInfo, auth, professionItems, professionOids, registrationNumber, addProfInfo); }
private void checkValues( ProfessionInfo profInfo, NamingAuthority auth, DirectoryString[] professionItems, DERObjectIdentifier[] professionOids, String registrationNumber, DEROctetString addProfInfo) { checkOptionalField("auth", auth, profInfo.getNamingAuthority()); checkMandatoryField("professionItems", professionItems[0], profInfo.getProfessionItems()[0]); if (professionOids != null) { checkOptionalField("professionOids", professionOids[0], profInfo.getProfessionOIDs()[0]); } checkOptionalField("registrationNumber", registrationNumber, profInfo.getRegistrationNumber()); checkOptionalField("addProfessionInfo", addProfInfo, profInfo.getAddProfessionInfo()); }
public void performTest() throws Exception { GeneralName name = new GeneralName(new X500Name("CN=hello world")); ASN1Sequence admissions = new DERSequence( new Admissions(name, new NamingAuthority(new ASN1ObjectIdentifier("1.2.3"), "url", new DirectoryString("fred")), new ProfessionInfo[0])); AdmissionSyntax syntax = new AdmissionSyntax(name, admissions); checkConstruction(syntax, name, admissions); syntax = AdmissionSyntax.getInstance(null); if (syntax != null) { fail("null getInstance() failed."); } try { AdmissionSyntax.getInstance(new Object()); fail("getInstance() failed to detect bad object."); } catch (IllegalArgumentException e) { // expected } }
public void performTest() throws Exception { GeneralName name = new GeneralName(new X500Name("CN=hello world")); NamingAuthority auth = new NamingAuthority(new ASN1ObjectIdentifier("1.2.3"), "url", new DirectoryString("fred")); Admissions admissions = new Admissions(name, auth, new ProfessionInfo[0]); checkConstruction(admissions, name, auth); admissions = Admissions.getInstance(null); if (admissions != null) { fail("null getInstance() failed."); } try { Admissions.getInstance(new Object()); fail("getInstance() failed to detect bad object."); } catch (IllegalArgumentException e) { // expected } }
public void performTest() throws Exception { GeneralName name = new GeneralName(new X509Name("CN=hello world")); ASN1Sequence admissions = new DERSequence( new Admissions(name, new NamingAuthority(new ASN1ObjectIdentifier("1.2.3"), "url", new DirectoryString("fred")), new ProfessionInfo[0])); AdmissionSyntax syntax = new AdmissionSyntax(name, admissions); checkConstruction(syntax, name, admissions); syntax = AdmissionSyntax.getInstance(null); if (syntax != null) { fail("null getInstance() failed."); } try { AdmissionSyntax.getInstance(new Object()); fail("getInstance() failed to detect bad object."); } catch (IllegalArgumentException e) { // expected } }
public void performTest() throws Exception { GeneralName name = new GeneralName(new X509Name("CN=hello world")); NamingAuthority auth = new NamingAuthority(new DERObjectIdentifier("1.2.3"), "url", new DirectoryString("fred")); Admissions admissions = new Admissions(name, auth, new ProfessionInfo[0]); checkConstruction(admissions, name, auth); admissions = Admissions.getInstance(null); if (admissions != null) { fail("null getInstance() failed."); } try { Admissions.getInstance(new Object()); fail("getInstance() failed to detect bad object."); } catch (IllegalArgumentException e) { // expected } }