예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
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
예제 #4
0
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
예제 #5
0
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)