<s> from nose . plugins . attrib import attr <EOL> from unittest import skip <EOL> from pyon . util . unit_test import PyonTestCase <EOL> from pyon . core . security . authentication import Authentication <EOL> @ attr ( '<STR_LIT>' , group = '<STR_LIT>' ) <EOL> class AuthenticationTest ( PyonTestCase ) : <EOL> def setUp ( self ) : <EOL> pass <EOL> @ skip ( "<STR_LIT>" ) <EOL> def test_authentication ( self ) : <EOL> private_key = """<STR_LIT>""" <EOL> certificate_crt = """<STR_LIT>""" <EOL> certificate_csr = """<STR_LIT>""" <EOL> message = "<STR_LIT>" <EOL> a = Authentication ( ) <EOL> certificate = certificate_crt <EOL> a . add_to_white_list ( certificate ) <EOL> status = a . authentication_enabled ( ) <EOL> self . assertTrue ( status == True or status == False ) <EOL> signed_hex = a . sign_message_hex ( message , private_key ) <EOL> v , ok = a . verify_message_hex ( message , certificate , signed_hex ) <EOL> self . assertEqual ( v , "<STR_LIT>" ) <EOL> self . assertEqual ( ok , "<STR_LIT:OK>" ) <EOL> signed = a . sign_message ( message , private_key ) <EOL> v , ok = a . verify_message ( message , certificate , signed ) <EOL> self . assertEqual ( v , "<STR_LIT>" ) <EOL> self . assertEqual ( ok , "<STR_LIT:OK>" ) <EOL> decoded_cert = a . decode_certificate_string ( certificate ) <EOL> self . assertEqual ( decoded_cert [ '<STR_LIT>' ] [ '<STR_LIT>' ] , "<STR_LIT>" ) </s>
