#!/usr/bin/env python

# This file is part of Window-Switch.
# Copyright (c) 2009-2013 Antoine Martin <antoine@nagafix.co.uk>
# Window-Switch is released under the terms of the GNU GPL v3

from twisted.conch.ssh import keys
import os
import traceback

def main():
	print "testing if we can load the keys"
	filename = os.path.expanduser("~/.ssh/id_rsa")
	passphrase = "yourpassphrase"
	try:
		key = keys.Key.fromFile(filename, passphrase=passphrase).keyObject
		assert key
		print "loaded key: %s" % key
	except Exception, e:
		print "cannot load private key: %s" % e
		traceback.print_exc()

if __name__ == "__main__":
	main()
