Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

17 lines (11 sloc) 0.497 kb
from __future__ import absolute_import
from __future__ import with_statement
from .utils import crypto, reraise_errors
class PrivateKey(object):
def __init__(self, key):
with reraise_errors("Invalid private key: %r"):
self._key = crypto.load_privatekey(crypto.FILETYPE_PEM, key)
def sign(self, data, digest):
"""sign string containing data."""
with reraise_errors("Unable to sign data: %r"):
return crypto.sign(self._key, data, digest)
Jump to Line
Something went wrong with that request. Please try again.