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)
Exemplo n.º 2
0
 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)
Exemplo n.º 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)
Exemplo n.º 5
0
 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)