Java 类org.bouncycastle.asn1.isismtt.x509.Admissions 实例源码

项目:gwt-crypto    文件:AdmissionsUnitTest.java   
private void checkConstruction(
    Admissions      admissions,
    GeneralName     name,
    NamingAuthority auth)
    throws IOException
{
    checkValues(admissions, name, auth);

    admissions = Admissions.getInstance(admissions);

    checkValues(admissions, name, auth);

    ASN1InputStream aIn = new ASN1InputStream(admissions.toASN1Primitive().getEncoded());

    ASN1Sequence info = (ASN1Sequence)aIn.readObject();

    admissions = Admissions.getInstance(info);

    checkValues(admissions, name, auth);
}
项目:irma_future_id    文件:AdmissionsUnitTest.java   
private void checkConstruction(
    Admissions      admissions,
    GeneralName     name,
    NamingAuthority auth)
    throws IOException
{
    checkValues(admissions, name, auth);

    admissions = Admissions.getInstance(admissions);

    checkValues(admissions, name, auth);

    ASN1InputStream aIn = new ASN1InputStream(admissions.toASN1Object().getEncoded());

    ASN1Sequence info = (ASN1Sequence)aIn.readObject();

    admissions = Admissions.getInstance(info);

    checkValues(admissions, name, auth);
}
项目:bc-java    文件:AdmissionsUnitTest.java   
private void checkConstruction(
    Admissions      admissions,
    GeneralName     name,
    NamingAuthority auth)
    throws IOException
{
    checkValues(admissions, name, auth);

    admissions = Admissions.getInstance(admissions);

    checkValues(admissions, name, auth);

    ASN1InputStream aIn = new ASN1InputStream(admissions.toASN1Object().getEncoded());

    ASN1Sequence info = (ASN1Sequence)aIn.readObject();

    admissions = Admissions.getInstance(info);

    checkValues(admissions, name, auth);
}
项目:gwt-crypto    文件:AdmissionSyntaxUnitTest.java   
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
    }
}
项目:gwt-crypto    文件:AdmissionSyntaxUnitTest.java   
private void checkValues(
    AdmissionSyntax syntax,
    GeneralName     authority,
    ASN1Sequence    admissions)
{
    checkMandatoryField("admissionAuthority", authority, syntax.getAdmissionAuthority());

    Admissions[] adm = syntax.getContentsOfAdmissions();

    if (adm.length != 1 || !adm[0].equals(admissions.getObjectAt(0)))
    {
        fail("admissions check failed");
    }
}
项目:gwt-crypto    文件:AdmissionsUnitTest.java   
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
    }
}
项目:gwt-crypto    文件:AdmissionsUnitTest.java   
private void checkValues(
    Admissions      admissions,
    GeneralName     name,
    NamingAuthority auth)
{
    checkMandatoryField("admissionAuthority", name, admissions.getAdmissionAuthority());
    checkMandatoryField("namingAuthority", auth, admissions.getNamingAuthority());
}
项目:irma_future_id    文件:AdmissionSyntaxUnitTest.java   
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
    }
}
项目:irma_future_id    文件:AdmissionSyntaxUnitTest.java   
private void checkValues(
    AdmissionSyntax syntax,
    GeneralName     authority,
    ASN1Sequence    admissions)
{
    checkMandatoryField("admissionAuthority", authority, syntax.getAdmissionAuthority());

    Admissions[] adm = syntax.getContentsOfAdmissions();

    if (adm.length != 1 || !adm[0].equals(admissions.getObjectAt(0)))
    {
        fail("admissions check failed");
    }
}
项目:irma_future_id    文件:AdmissionsUnitTest.java   
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
    }
}
项目:irma_future_id    文件:AdmissionsUnitTest.java   
private void checkValues(
    Admissions      admissions,
    GeneralName     name,
    NamingAuthority auth)
{
    checkMandatoryField("admissionAuthority", name, admissions.getAdmissionAuthority());
    checkMandatoryField("namingAuthority", auth, admissions.getNamingAuthority());
}
项目:bc-java    文件:AdmissionSyntaxUnitTest.java   
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
    }
}
项目:bc-java    文件:AdmissionSyntaxUnitTest.java   
private void checkValues(
    AdmissionSyntax syntax,
    GeneralName     authority,
    ASN1Sequence    admissions)
{
    checkMandatoryField("admissionAuthority", authority, syntax.getAdmissionAuthority());

    Admissions[] adm = syntax.getContentsOfAdmissions();

    if (adm.length != 1 || !adm[0].equals(admissions.getObjectAt(0)))
    {
        fail("admissions check failed");
    }
}
项目:bc-java    文件:AdmissionsUnitTest.java   
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
    }
}
项目:bc-java    文件:AdmissionsUnitTest.java   
private void checkValues(
    Admissions      admissions,
    GeneralName     name,
    NamingAuthority auth)
{
    checkMandatoryField("admissionAuthority", name, admissions.getAdmissionAuthority());
    checkMandatoryField("namingAuthority", auth, admissions.getNamingAuthority());
}