Package com.consol.citrus.ssh.server

Examples of com.consol.citrus.ssh.server.SinglePublicKeyAuthenticator


    }

    @Test
    public void withFile() throws IOException {
        File temp = copyToTempFile("/com/consol/citrus/ssh/allowed_test_key.pem");
        SinglePublicKeyAuthenticator auth = new SinglePublicKeyAuthenticator("roland",temp.getAbsolutePath());
        PublicKey pKey = getPublicKeyFromStream(new FileInputStream(temp));
        assertTrue(auth.authenticate("roland", pKey, null));
        assertFalse(auth.authenticate("guenther",pKey,null));

        temp = copyToTempFile("/com/consol/citrus/ssh/forbidden_test_key.pem");
        pKey = getPublicKeyFromStream(new FileInputStream(temp));
        assertFalse(auth.authenticate("roland",pKey,null));
    }
View Full Code Here


        assertFalse(auth.authenticate("roland",pKey,null));
    }

    @Test(expectedExceptions = CitrusRuntimeException.class,expectedExceptionsMessageRegExp = ".*com/consol/citrus/ssh/citrus.pem.*")
    public void invalidKeyFormat() {
        new SinglePublicKeyAuthenticator("roland","classpath:com/consol/citrus/ssh/citrus.pem");
    }
View Full Code Here

        new SinglePublicKeyAuthenticator("roland","classpath:com/consol/citrus/ssh/citrus.pem");
    }

    @Test(expectedExceptions = CitrusRuntimeException.class,expectedExceptionsMessageRegExp = ".*blubber\\.bla.*")
    public void notInClasspath() {
        new SinglePublicKeyAuthenticator("roland","classpath:com/consol/citrus/ssh/blubber.bla");
    }
View Full Code Here

        new SinglePublicKeyAuthenticator("roland","classpath:com/consol/citrus/ssh/blubber.bla");
    }

    @Test(expectedExceptions = CitrusRuntimeException.class,expectedExceptionsMessageRegExp = ".*/no/valid/path.*")
    public void invalidFilePath() {
        new SinglePublicKeyAuthenticator("roland","/no/valid/path");
    }
View Full Code Here

        assertTrue(SecurityUtils.isBouncyCastleRegistered());
    }

    @Test
    public void withClassPath() throws IOException {
        SinglePublicKeyAuthenticator auth = new SinglePublicKeyAuthenticator("roland","classpath:com/consol/citrus/ssh/allowed_test_key.pem");
        PublicKey pKey = getPublicKey("/com/consol/citrus/ssh/allowed_test_key.pem");
        assertTrue(auth.authenticate("roland", pKey, null));
        assertFalse(auth.authenticate("guenther",pKey,null));
        pKey = getPublicKey("/com/consol/citrus/ssh/forbidden_test_key.pem");
        assertFalse(auth.authenticate("roland",pKey,null));
    }
View Full Code Here

TOP

Related Classes of com.consol.citrus.ssh.server.SinglePublicKeyAuthenticator

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.