def test_displayPublicKeyEncrypted(self):
        """
        L{displayPublicKey} prints out the public key associated with a given
        private key using the given passphrase when it's encrypted.
        """
        filename = self.mktemp()
        pubKey = Key.fromString(publicRSA_openssh)
        FilePath(filename).setContent(privateRSA_openssh_encrypted)
        displayPublicKey({'filename': filename, 'pass': 'encrypted'})
        displayed = self.stdout.getvalue().strip('\n')
        if isinstance(displayed, unicode):
            displayed = displayed.encode("ascii")
        self.assertEqual(
            displayed,
            pubKey.toString('openssh'))

        L{displayPublicKey} prints out the public key associated with a given
        private key using the given passphrase when it's encrypted.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_ckeygen.py