File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,8 +81,8 @@ def decode_ec_private_key(der):
8181 return {
8282 Attribute .KEY_TYPE : KeyType .EC ,
8383 Attribute .CLASS : ObjectClass .PRIVATE_KEY ,
84- Attribute .EC_PARAMS : asn1 ['parameters' ].dump (),
85- Attribute .VALUE : asn1 ['private_key' ],
84+ Attribute .EC_PARAMS : asn1 ['parameters' ].chosen . dump (),
85+ Attribute .VALUE : asn1 ['private_key' ]. contents ,
8686 }
8787
8888
Original file line number Diff line number Diff line change @@ -143,10 +143,9 @@ def test_import_key_pair(self):
143143 """ )
144144 pub = self .session .create_object (decode_ec_public_key (pub ))
145145
146- # FIXME: why can't I sign this?
147- # signature = priv.sign(b'Example', mechanism=Mechanism.ECDSA)
148- # self.assertTrue(pub.verify(b'Example', signature,
149- # mechanism=Mechanism.ECDSA))
146+ signature = priv .sign (b'Example' , mechanism = Mechanism .ECDSA )
147+ self .assertTrue (pub .verify (b'Example' , signature ,
148+ mechanism = Mechanism .ECDSA ))
150149
151150 @requires (Mechanism .EC_EDWARDS_KEY_PAIR_GEN , Mechanism .EDDSA )
152151 def test_sign_eddsa (self ):
@@ -162,4 +161,3 @@ def test_sign_eddsa(self):
162161 data = b'HI BOB!'
163162 eddsa = priv .sign (data , mechanism = mechanism )
164163 self .assertTrue (pub .verify (data , eddsa , mechanism = mechanism ))
165-
You can’t perform that action at this time.
0 commit comments