Ejemplo n.º 1
0
 def testUsingTestData(self):
     """Test for signed_info_from_string() using test data"""
     new_si = ds.signed_info_from_string(ds_data.TEST_SIGNED_INFO)
     assert new_si.id == "id"
     assert isinstance(new_si.canonicalization_method, ds.CanonicalizationMethod)
     assert isinstance(new_si.signature_method, ds.SignatureMethod)
     assert isinstance(new_si.reference[0], ds.Reference)
Ejemplo n.º 2
0
 def testUsingTestData(self):
   """Test for signed_info_from_string() using test data"""
   new_si = ds.signed_info_from_string(ds_data.TEST_SIGNED_INFO)
   assert new_si.id == "id"
   assert isinstance(new_si.canonicalization_method,
                           ds.CanonicalizationMethod)
   assert isinstance(new_si.signature_method, ds.SignatureMethod)
   assert isinstance(new_si.reference[0], ds.Reference)
Ejemplo n.º 3
0
 def testAccessors(self):
     """Test for SignedInfo accessors"""
     self.si.id = "id"
     self.si.canonicalization_method = ds.canonicalization_method_from_string(ds_data.TEST_CANONICALIZATION_METHOD)
     self.si.signature_method = ds.signature_method_from_string(ds_data.TEST_SIGNATURE_METHOD)
     self.si.reference.append(ds.reference_from_string(ds_data.TEST_REFERENCE))
     new_si = ds.signed_info_from_string(self.si.to_string())
     assert new_si.id == "id"
     assert isinstance(new_si.canonicalization_method, ds.CanonicalizationMethod)
     assert isinstance(new_si.signature_method, ds.SignatureMethod)
     assert isinstance(new_si.reference[0], ds.Reference)
Ejemplo n.º 4
0
    def testAccessors(self):
        """Test for Signature accessors"""
        self.signature.id = "id"
        self.signature.signed_info = ds.signed_info_from_string(ds_data.TEST_SIGNED_INFO)
        self.signature.signature_value = ds.signature_value_from_string(ds_data.TEST_SIGNATURE_VALUE)
        self.signature.key_info = ds.key_info_from_string(ds_data.TEST_KEY_INFO)
        self.signature.object.append(ds.object_from_string(ds_data.TEST_OBJECT))

        new_signature = ds.signature_from_string(self.signature.to_string())
        assert new_signature.id == "id"
        assert isinstance(new_signature.signed_info, ds.SignedInfo)
        assert isinstance(new_signature.signature_value, ds.SignatureValue)
        assert isinstance(new_signature.key_info, ds.KeyInfo)
        assert isinstance(new_signature.object[0], ds.Object)
Ejemplo n.º 5
0
 def testAccessors(self):
   """Test for SignedInfo accessors"""
   self.si.id = "id"
   self.si.canonicalization_method = ds.canonicalization_method_from_string(
     ds_data.TEST_CANONICALIZATION_METHOD)
   self.si.signature_method = ds.signature_method_from_string(
     ds_data.TEST_SIGNATURE_METHOD)
   self.si.reference.append(ds.reference_from_string(
     ds_data.TEST_REFERENCE))
   new_si = ds.signed_info_from_string(self.si.to_string())
   assert new_si.id == "id"
   assert isinstance(new_si.canonicalization_method,
                           ds.CanonicalizationMethod)
   assert isinstance(new_si.signature_method, ds.SignatureMethod)
   assert isinstance(new_si.reference[0], ds.Reference)
Ejemplo n.º 6
0
  def testAccessors(self):
    """Test for Signature accessors"""
    self.signature.id = "id"
    self.signature.signed_info = ds.signed_info_from_string(
      ds_data.TEST_SIGNED_INFO)
    self.signature.signature_value = ds.signature_value_from_string(
      ds_data.TEST_SIGNATURE_VALUE)
    self.signature.key_info = ds.key_info_from_string(ds_data.TEST_KEY_INFO)
    self.signature.object.append(ds.object_from_string(ds_data.TEST_OBJECT))

    new_signature = ds.signature_from_string(self.signature.to_string())
    assert new_signature.id == "id"
    assert isinstance(new_signature.signed_info, ds.SignedInfo)
    assert isinstance(new_signature.signature_value, ds.SignatureValue)
    assert isinstance(new_signature.key_info, ds.KeyInfo)
    assert isinstance(new_signature.object[0], ds.Object)