コード例 #1
0
def test_verify(name):
    # Load the SAML XML document to verify.
    filename = path.join(BASE_DIR, '%s-signed.xml' % name)
    expected = etree.parse(filename).getroot()

    # Sign the result.
    with open(path.join(BASE_DIR, 'rsapub.pem'), 'r') as stream:
        assert saml.verify(expected, stream)
コード例 #2
0
ファイル: test_schema.py プロジェクト: mehcode/python-saml
def test_verify(name):
    # Load the SAML XML document to verify.
    filename = path.join(BASE_DIR, '%s-signed.xml' % name)
    expected = etree.parse(filename).getroot()

    # Sign the result.
    with open(path.join(BASE_DIR, 'rsapub.pem'), 'r') as stream:
        assert saml.verify(expected, stream)
コード例 #3
0
def test_verify_with_bad_signature_returns_False(name):
    filename = path.join(BASE_DIR, '%s-signed.xml' % name)
    expected = etree.parse(filename).getroot()

    signature_node = xmlsec.tree.find_node(expected, xmlsec.Node.SIGNATURE)
    signature_node.clear()

    with open(path.join(BASE_DIR, 'rsapub.pem'), 'r') as stream:
        assert saml.verify(expected, stream) is False
コード例 #4
0
ファイル: test_schema.py プロジェクト: mehcode/python-saml
def test_verify_with_bad_signature_returns_False(name):
    filename = path.join(BASE_DIR, '%s-signed.xml' % name)
    expected = etree.parse(filename).getroot()

    signature_node = xmlsec.tree.find_node(expected, xmlsec.Node.SIGNATURE)
    signature_node.clear()

    with open(path.join(BASE_DIR, 'rsapub.pem'), 'r') as stream:
        assert saml.verify(expected, stream) is False
コード例 #5
0
def test_verify_with_no_signature_returns_False(name):
    filename = path.join(BASE_DIR, '%s-simple.xml' % name)
    expected = etree.parse(filename).getroot()

    with open(path.join(BASE_DIR, 'rsapub.pem'), 'r') as stream:
        assert saml.verify(expected, stream) is False
コード例 #6
0
ファイル: test_schema.py プロジェクト: mehcode/python-saml
def test_verify_with_no_signature_returns_False(name):
    filename = path.join(BASE_DIR, '%s-simple.xml' % name)
    expected = etree.parse(filename).getroot()

    with open(path.join(BASE_DIR, 'rsapub.pem'), 'r') as stream:
        assert saml.verify(expected, stream) is False