@@ -52,17 +52,36 @@ def test_emit(self):
5252 """Basic sanity check on the code emitters."""
5353 k = ECDSA256P1 .generate ()
5454
55+ pubpem = io .StringIO ()
56+ k .emit_public_pem (pubpem )
57+ self .assertIn ("BEGIN PUBLIC KEY" , pubpem .getvalue ())
58+ self .assertIn ("END PUBLIC KEY" , pubpem .getvalue ())
59+
5560 ccode = io .StringIO ()
5661 k .emit_c_public (ccode )
5762 self .assertIn ("ecdsa_pub_key" , ccode .getvalue ())
5863 self .assertIn ("ecdsa_pub_key_len" , ccode .getvalue ())
5964
65+ hashccode = io .StringIO ()
66+ k .emit_c_public_hash (hashccode )
67+ self .assertIn ("ecdsa_pub_key_hash" , hashccode .getvalue ())
68+ self .assertIn ("ecdsa_pub_key_hash_len" , hashccode .getvalue ())
69+
6070 rustcode = io .StringIO ()
6171 k .emit_rust_public (rustcode )
6272 self .assertIn ("ECDSA_PUB_KEY" , rustcode .getvalue ())
6373
74+ # raw data - bytes
75+ pubraw = io .BytesIO ()
76+ k .emit_raw_public (pubraw )
77+ self .assertTrue (len (pubraw .getvalue ()) > 0 )
78+
79+ hashraw = io .BytesIO ()
80+ k .emit_raw_public_hash (hashraw )
81+ self .assertTrue (len (hashraw .getvalue ()) > 0 )
82+
6483 def test_emit_pub (self ):
65- """Basic sanity check on the code emitters."""
84+ """Basic sanity check on the code emitters, from public key ."""
6685 pubname = self .tname ("public.pem" )
6786 k = ECDSA256P1 .generate ()
6887 k .export_public (pubname )
0 commit comments