Examples of TestKeyPair


Examples of org.apache.harmony.security.tests.support.TestKeyPair

     * Expected: <code>null</code> as return value<br>
     * @throws InvalidKeySpecException
     */
    public final void testGetTrustedCer02() throws Exception {

        PublicKey pk = new TestKeyPair(keyAlg).getPublic();

        // sub testcase 1
        TrustAnchor ta =
            new TrustAnchor(validCaNameRfc2253, pk, null);
        assertNull("null1", ta.getTrustedCert());
View Full Code Here

Examples of org.apache.harmony.security.tests.support.TestKeyPair

     * by the method<br>
     * @throws InvalidKeySpecException
     */
    public final void testGetCA01() throws Exception {

        PublicKey pk = new TestKeyPair(keyAlg).getPublic();

        // sub testcase 1
        TrustAnchor ta =
            new TrustAnchor(validCaNameRfc2253, pk, null);
        X500Principal ca = ta.getCA();
View Full Code Here

Examples of org.apache.harmony.security.tests.support.TestKeyPair

     */
    public void testSetSubjectPublicKeyAlgID() throws Exception {
        String pkaid1 = "1.2.840.113549.1.1.1"; // RSA (source: http://asn1.elibel.tm.fr)
        String pkaid2 = "1.2.840.10040.4.1"; // DSA (source: http://asn1.elibel.tm.fr)

        PublicKey pkey1 = new TestKeyPair("RSA").getPublic();
        PublicKey pkey2 = new TestKeyPair("DSA").getPublic();

        TestCert cert_1 = new TestCert(pkey1);
        TestCert cert_2 = new TestCert(pkey2);
        X509CertSelector selector = new X509CertSelector();

View Full Code Here

Examples of org.apache.harmony.security.tests.support.TestKeyPair

     * setSubjectPublicKey(PublicKey key) method testing.
     * Tests if any certificates match in the case of null criteria,
     * if [not]proper certificates [do not]match.
     */
    public void testSetSubjectPublicKey1() throws Exception {
        PublicKey pkey1 = new TestKeyPair("RSA").getPublic();
        PublicKey pkey2 = new TestKeyPair("DSA").getPublic();

        TestCert cert_1 = new TestCert(pkey1);
        TestCert cert_2 = new TestCert(pkey2);
        X509CertSelector selector = new X509CertSelector();

View Full Code Here

Examples of org.apache.harmony.security.tests.support.TestKeyPair

     * Tests if the method return null in the case of not specified criteria,
     * if the returned value corresponds to specified
     */
    public void testGetSubjectPublicKey1() throws Exception {

        PublicKey pkey = new TestKeyPair("RSA").getPublic();

        X509CertSelector selector = new X509CertSelector();

        assertNull("Selector should return null",
                                            selector.getSubjectPublicKey());
View Full Code Here

Examples of org.apache.harmony.security.tests.support.TestKeyPair

     * Tests if any certificates match in the case of null criteria,
     * if [not]proper certificates [do not]match, and if the initialization
     * object are copied during the initialization.
     */
    public void testSetSubjectPublicKey2() throws Exception {
        PublicKey pkey1 = new TestKeyPair("RSA").getPublic();
        PublicKey pkey2 = new TestKeyPair("DSA").getPublic();

        byte[] encoding1 = pkey1.getEncoded();
        byte[] encoding2 = pkey2.getEncoded();
        TestCert cert_1 = new TestCert(pkey1);
        TestCert cert_2 = new TestCert(pkey2);
View Full Code Here

Examples of org.apache.harmony.security.tests.support.TestKeyPair

     * Tests if the method return null in the case of not specified criteria,
     * if the returned value corresponds to specified
     */
    public void testGetSubjectPublicKey2() throws Exception {

        PublicKey pkey = new TestKeyPair("RSA").getPublic();

        X509CertSelector selector = new X509CertSelector();

        assertNull("Selector should return null",
                                            selector.getSubjectPublicKey());
View Full Code Here

Examples of org.apache.harmony.security.tests.support.TestKeyPair

                new Date(300000000L)
        };
        String pkAlgID = "1.2.840.113549.1.1.4"; // MD5 with RSA encryption (source: http://asn1.elibel.tm.fr)
        PublicKey pkey;

        pkey = new TestKeyPair("RSA").getPublic();

        boolean[] keyUsage = new boolean[]
                    {true, true, true, true, true, true, true, true, false};
        // OID values was taken from rfc 3280
        HashSet extKeyUsage = new HashSet(Arrays.asList(new String[] {
View Full Code Here

Examples of org.apache.harmony.security.tests.support.TestKeyPair

                new Date(300000000L)
        };
        String pkAlgID = "1.2.840.113549.1.1.1"; // RSA encryption (source: http://asn1.elibel.tm.fr)
        PublicKey pkey;

        pkey = new TestKeyPair("RSA").getPublic();

        boolean[] keyUsage = new boolean[]
                    {true, true, true, true, true, true, true, true, false};
        // OID values was taken from rfc 3280
        HashSet extKeyUsage = new HashSet(Arrays.asList(new String[] {
View Full Code Here

Examples of org.apache.harmony.security.tests.support.TestKeyPair

                new Date(300000000L)
        };
        String pkAlgID = "1.2.840.113549.1.1.1"; // RSA encryption (source: http://asn1.elibel.tm.fr)
        PublicKey pkey;

        pkey = new TestKeyPair("RSA").getPublic();

        boolean[] keyUsage = new boolean[]
                    {true, true, true, true, true, true, true, true, false};
        // OID values was taken from rfc 3280
        HashSet extKeyUsage = new HashSet(Arrays.asList(new String[] {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.