def validate_certificate(self, certificate_metadata):
     with open(certificate_metadata.unsigned_cert_file_name) as cert:
         certificate_json = json.load(cert)
         # Both tests raise exception on failure
         # 1. json schema validation
         validate_v2(certificate_json)
         # 2. detect if there are any unmapped fields
         normalize_jsonld(certificate_json, detect_unmapped_fields=True)
 def validate_certificate(self, certificate_metadata):
     with open(certificate_metadata.unsigned_cert_file_name) as cert:
         certificate_json = json.load(cert)
         # Both tests raise exception on failure
         # 1. json schema validation
         validate_v2(certificate_json)
         # 2. detect if there are any unmapped fields
         normalize_jsonld(certificate_json, detect_unmapped_fields=True)
示例#3
0
 def test_v2(self):
     with open('../examples/2.0/sample_signed_2.0.json') as data_f:
         certificate = json.load(data_f)
         valid = validate_v2(certificate)
         self.assertTrue(valid)
 def test_v2(self):
     with open('../examples/2.0/bbba8553-8ec1-445f-82c9-a57251dd731c.json'
               ) as data_f:
         certificate = json.load(data_f)
         valid = validate_v2(certificate)
         self.assertTrue(valid)
 def validate_certificate(self, certificate_metadata):
     with open(certificate_metadata.unsigned_cert_file_name) as cert:
         certificate_json = json.load(cert)
         validate_v2(certificate_json)