def test_loading_private_key(): filename = os.path.join(os.getcwd(), 'keys/sample/sample-private-key.pem') config = {smd.PRIVATE_KEY_FILENAME: filename} assert type(filename) is str xml_signing.load_private_key(config) filename = unicode(filename) config = {smd.PRIVATE_KEY_FILENAME: filename} xml_signing.load_private_key(config)
def test_signing_data_with_private_key(): filename = os.path.join(PROJECT_ROOT, 'keys/sample/sample-private-key.pem') config = {smd.PRIVATE_KEY_FILENAME: filename} private_key = xml_signing.load_private_key(config) data = "Some interesting data." signature = xml_signing.sign_with_rsa(private_key, data) assert signature != data
def test_signing_data_with_private_key(): filename = os.path.join(os.getcwd(), 'keys/sample/sample-private-key.pem') config = {smd.PRIVATE_KEY_FILENAME: filename} private_key = xml_signing.load_private_key(config) data = "Some interesting data." signature = xml_signing.sign_with_rsa(private_key, data) assert signature != data
def test_loading_private_key(): filename = os.path.join(PROJECT_ROOT, 'keys/sample/sample-private-key.pem') config = {smd.PRIVATE_KEY_FILENAME: filename} assert type(filename) is six.text_type xml_signing.load_private_key(config)