Package javax.security.auth.x500

Examples of javax.security.auth.x500.X500Principal


    /**
     * getIssuerDN() method testing.
     */
    public void testGetIssuerDN() {
        assertEquals("Incorrect issuer",
                new X500Principal(issuerName).getName(),
                certificate.getIssuerDN().getName());
    }
View Full Code Here


    /**
     * getIssuerX500Principal() method testing.
     */
    public void testGetIssuerX500Principal() {
        assertEquals("Incorrect issuer",
                new X500Principal(issuerName),
                certificate.getIssuerX500Principal());
    }
View Full Code Here

    /**
     * getSubjectDN() method testing.
     */
    public void testGetSubjectDN() {
        assertEquals("Incorrect subject",
                new X500Principal(subjectName).getName(),
                certificate.getSubjectDN().getName());
    }
View Full Code Here

    /**
     * getSubjectX500Principal() method testing.
     */
    public void testGetSubjectX500Principal() {
        assertEquals("Incorrect subject",
                new X500Principal(subjectName),
                certificate.getSubjectX500Principal());
    }
View Full Code Here

    /**
     * getIssuerDN() method testing.
     */
    public void testGetIssuerDN() {
        assertEquals("Incorrect issuer value",
                new X500Principal(issuerName), crl.getIssuerDN());
    }
View Full Code Here

    /**
     * getIssuerX500Principal() method testing.
     */
    public void testGetIssuerX500Principal() {
        assertEquals("Incorrect issuer value",
                new X500Principal(issuerName), crl.getIssuerDN());
    }
View Full Code Here

            // byte[] x500name_data = uncapsulateByteArray(name_data);

            try {

                Subject subject = new Subject();
                subject.getPrincipals().add(new X500Principal(x500name_data));
                SecurityContext.setAuthenticatedSubject(subject);

            }
            catch (IllegalArgumentException ex) {
View Full Code Here

     * setIssuer(X500Principal issuer) method testing.
     * Tests if any certificates match in the case of null criteria,
     * if [not]proper certificates [do not]match
     */
    public void testSetIssuer1() {
        X500Principal iss1 = new X500Principal("O=First Org.");
        X500Principal iss2 = new X500Principal("O=Second Org.");
        TestCert cert_1 = new TestCert(iss1);
        TestCert cert_2 = new TestCert(iss2);
        X509CertSelector selector = new X509CertSelector();

        selector.setIssuer((X500Principal) null);
View Full Code Here

     * getIssuer() method testing.
     * Tests if the method return null in the case of not specified criteria,
     * if the returned value [does not]corresponds to [not]specified
     */
    public void testGetIssuer() {
        X500Principal iss1 = new X500Principal("O=First Org.");
        X500Principal iss2 = new X500Principal("O=Second Org.");
        X509CertSelector selector = new X509CertSelector();

        assertNull("Selector should return null", selector.getIssuer());
        selector.setIssuer(iss1);
        assertEquals("The returned issuer should be equal to specified",
                                        iss1, selector.getIssuer());
        assertFalse("The returned issuer should differ",
                                        iss2.equals(selector.getIssuer()));
    }
View Full Code Here

     * if [not]proper certificates [do not]match
     */
    public void testSetIssuer2() throws IOException {
        String name1 = "O=First Org.";
        String name2 = "O=Second Org.";
        X500Principal iss1 = new X500Principal(name1);
        X500Principal iss2 = new X500Principal(name2);
        TestCert cert_1 = new TestCert(iss1);
        TestCert cert_2 = new TestCert(iss2);
        X509CertSelector selector = new X509CertSelector();

        selector.setIssuer((String) null);
View Full Code Here

TOP

Related Classes of javax.security.auth.x500.X500Principal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.