summaryrefslogtreecommitdiff
path: root/ssh.py
blob: 4b7e94c866845033ea9e611757733bb7e627607d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# vim: set filencoding=utf8
"""
SSH Key Signing

@author: Mike Crute (mcrute@ag.com)
@organization: American Greetings Interactive
@date: May 03, 2010

Commands to sign and verify revisions with your
ssh key.
"""

from structutils import bytes_to_int
from sshagent import SSHAgent

key = open('/Users/mcrute/.ssh/id_rsa.ag.pub').read()
key = key.split()[1].decode('base64')

agent = SSHAgent()
signature = agent.sign("Hello world!", key)
print bytes_to_int(signature)