Java 类org.bouncycastle.asn1.x509.Targets 实例源码

项目:gwt-crypto    文件:TargetInformationTest.java   
public void performTest() throws Exception
{
    Target[] targets = new Target[2];
    Target targetName = new Target(Target.targetName, new GeneralName(GeneralName.dNSName, "www.test.com"));
    Target targetGroup = new Target(Target.targetGroup, new GeneralName(GeneralName.directoryName, "o=Test, ou=Test"));
    targets[0] = targetName;
    targets[1] = targetGroup;
    Targets targetss = new Targets(targets);
    TargetInformation targetInformation1 = new TargetInformation(targetss);
    // use an Target array
    TargetInformation targetInformation2 = new TargetInformation(targets);
    // targetInformation1 and targetInformation2 must have same
    // encoding.
    if (!targetInformation1.equals(targetInformation2))
    {
        fail("targetInformation1 and targetInformation2 should have the same encoding.");
    }
    TargetInformation targetInformation3 = TargetInformation.getInstance(targetInformation1);
    TargetInformation targetInformation4 = TargetInformation.getInstance(targetInformation2);
    if (!targetInformation3.equals(targetInformation4))
    {
        fail("targetInformation3 and targetInformation4 should have the same encoding.");
    }
}
项目:irma_future_id    文件:TargetInformationTest.java   
public void performTest() throws Exception
{
    Target[] targets = new Target[2];
    Target targetName = new Target(Target.targetName, new GeneralName(GeneralName.dNSName, "www.test.com"));
    Target targetGroup = new Target(Target.targetGroup, new GeneralName(GeneralName.directoryName, "o=Test, ou=Test"));
    targets[0] = targetName;
    targets[1] = targetGroup;
    Targets targetss = new Targets(targets);
    TargetInformation targetInformation1 = new TargetInformation(targetss);
    // use an Target array
    TargetInformation targetInformation2 = new TargetInformation(targets);
    // targetInformation1 and targetInformation2 must have same
    // encoding.
    if (!targetInformation1.equals(targetInformation2))
    {
        fail("targetInformation1 and targetInformation2 should have the same encoding.");
    }
    TargetInformation targetInformation3 = TargetInformation.getInstance(targetInformation1);
    TargetInformation targetInformation4 = TargetInformation.getInstance(targetInformation2);
    if (!targetInformation3.equals(targetInformation4))
    {
        fail("targetInformation3 and targetInformation4 should have the same encoding.");
    }
}
项目:bc-java    文件:TargetInformationTest.java   
public void performTest() throws Exception
{
    Target[] targets = new Target[2];
    Target targetName = new Target(Target.targetName, new GeneralName(GeneralName.dNSName, "www.test.com"));
    Target targetGroup = new Target(Target.targetGroup, new GeneralName(GeneralName.directoryName, "o=Test, ou=Test"));
    targets[0] = targetName;
    targets[1] = targetGroup;
    Targets targetss = new Targets(targets);
    TargetInformation targetInformation1 = new TargetInformation(targetss);
    // use an Target array
    TargetInformation targetInformation2 = new TargetInformation(targets);
    // targetInformation1 and targetInformation2 must have same
    // encoding.
    if (!targetInformation1.equals(targetInformation2))
    {
        fail("targetInformation1 and targetInformation2 should have the same encoding.");
    }
    TargetInformation targetInformation3 = TargetInformation.getInstance(targetInformation1);
    TargetInformation targetInformation4 = TargetInformation.getInstance(targetInformation2);
    if (!targetInformation3.equals(targetInformation4))
    {
        fail("targetInformation3 and targetInformation4 should have the same encoding.");
    }
}