twisted.conch.checkers.SSHPublicKeyChecker

Here are the examples of the python api twisted.conch.checkers.SSHPublicKeyChecker taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

3 Source : test_checkers.py
with MIT License
from autofelix

    def setUp(self):
        self.credentials = SSHPrivateKey(
             b'alice', b'ssh-rsa', keydata.publicRSA_openssh, b'foo',
             keys.Key.fromString(keydata.privateRSA_openssh).sign(b'foo'))
        self.keydb = _KeyDB(lambda _: [
            keys.Key.fromString(keydata.publicRSA_openssh)])
        self.checker = checkers.SSHPublicKeyChecker(self.keydb)


    def test_credentialsWithoutSignature(self):

3 Source : cred_sshkeys.py
with MIT License
from autofelix

        def generateChecker(self, argstring=''):
            """
            This checker factory ignores the argument string. Everything
            needed to authenticate users is pulled out of the public keys
            listed in user .ssh/ directories.
            """
            return SSHPublicKeyChecker(UNIXAuthorizedKeysFiles())



    theSSHKeyCheckerFactory = SSHKeyCheckerFactory()

0 Source : test_endpoints.py
with MIT License
from autofelix

    def setupKeyChecker(self, portal, users):
        """
        Create an L{ISSHPrivateKey} checker which recognizes C{users} and add it
        to C{portal}.

        @param portal: A L{Portal} to which to add the checker.
        @type portal: L{Portal}

        @param users: The users and their keys the checker will recognize.  Keys
            are byte strings giving user names.  Values are byte strings giving
            OpenSSH-formatted private keys.
        @type users: L{dict}
        """
        mapping = dict([(k,[Key.fromString(v).public()])
                        for k, v in iteritems(users)])
        checker = SSHPublicKeyChecker(InMemorySSHKeyDB(mapping))
        portal.registerChecker(checker)


    def test_publicKeyAuthenticationFailure(self):