11package com .danubetech .dataintegrity ;
22
33import com .apicatalog .jsonld .loader .DocumentLoader ;
4- import com .danubetech .dataintegrity .jsonld .LDSecurityContexts ;
5- import com .danubetech .dataintegrity .jsonld .LDSecurityKeywords ;
4+ import com .danubetech .dataintegrity .jsonld .DataIntegrityContexts ;
5+ import com .danubetech .dataintegrity .jsonld .DataIntegrityKeywords ;
66import com .fasterxml .jackson .annotation .JsonCreator ;
77import foundation .identity .jsonld .JsonLDObject ;
88import foundation .identity .jsonld .JsonLDUtils ;
1515
1616public class DataIntegrityProof extends JsonLDObject {
1717
18- public static final URI [] DEFAULT_JSONLD_CONTEXTS = { LDSecurityContexts . JSONLD_CONTEXT_W3ID_SECURITY_V3 };
18+ public static final URI [] DEFAULT_JSONLD_CONTEXTS = { DataIntegrityContexts . JSONLD_CONTEXT_W3ID_DATAINTEGRITY_V2 };
1919 public static final String [] DEFAULT_JSONLD_TYPES = { };
20- public static final String DEFAULT_JSONLD_PREDICATE = LDSecurityKeywords .JSONLD_TERM_PROOF ;
21- public static final DocumentLoader DEFAULT_DOCUMENT_LOADER = LDSecurityContexts .DOCUMENT_LOADER ;
20+ public static final String DEFAULT_JSONLD_PREDICATE = DataIntegrityKeywords .JSONLD_TERM_PROOF ;
21+ public static final DocumentLoader DEFAULT_DOCUMENT_LOADER = DataIntegrityContexts .DOCUMENT_LOADER ;
2222
2323 @ JsonCreator
2424 public DataIntegrityProof () {
@@ -57,17 +57,17 @@ public DataIntegrityProof build() {
5757 super .build ();
5858
5959 // add JSON-LD properties
60- if (this .cryptosuite != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , LDSecurityKeywords .JSONLD_TERM_CRYPTOSUITE , this .cryptosuite );
61- if (this .created != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , LDSecurityKeywords .JSONLD_TERM_CREATED , JsonLDUtils .dateToString (this .created ));
62- if (this .expires != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , LDSecurityKeywords .JSONLD_TERM_EXPIRES , JsonLDUtils .dateToString (this .expires ));
63- if (this .domain != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , LDSecurityKeywords .JSONLD_TERM_DOMAIN , this .domain );
64- if (this .challenge != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , LDSecurityKeywords .JSONLD_TERM_CHALLENGE , this .challenge );
65- if (this .nonce != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , LDSecurityKeywords .JSONLD_TERM_NONCE , this .nonce );
66- if (this .verificationMethod != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , LDSecurityKeywords .JSONLD_TERM_VERIFICATIONMETHOD , JsonLDUtils .uriToString (this .verificationMethod ));
67- if (this .proofPurpose != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , LDSecurityKeywords .JSONLD_TERM_PROOFPURPOSE , this .proofPurpose );
68- if (this .previousProof != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , LDSecurityKeywords .JSONLD_TERM_PREVIOUSPROOF , this .previousProof );
69- if (this .proofValue != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , LDSecurityKeywords .JSONLD_TERM_PROOFVALUE , this .proofValue );
70- if (this .jws != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , LDSecurityKeywords .JSONLD_TERM_JWS , this .jws );
60+ if (this .cryptosuite != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , DataIntegrityKeywords .JSONLD_TERM_CRYPTOSUITE , this .cryptosuite );
61+ if (this .created != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , DataIntegrityKeywords .JSONLD_TERM_CREATED , JsonLDUtils .dateToString (this .created ));
62+ if (this .expires != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , DataIntegrityKeywords .JSONLD_TERM_EXPIRES , JsonLDUtils .dateToString (this .expires ));
63+ if (this .domain != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , DataIntegrityKeywords .JSONLD_TERM_DOMAIN , this .domain );
64+ if (this .challenge != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , DataIntegrityKeywords .JSONLD_TERM_CHALLENGE , this .challenge );
65+ if (this .nonce != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , DataIntegrityKeywords .JSONLD_TERM_NONCE , this .nonce );
66+ if (this .verificationMethod != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , DataIntegrityKeywords .JSONLD_TERM_VERIFICATIONMETHOD , JsonLDUtils .uriToString (this .verificationMethod ));
67+ if (this .proofPurpose != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , DataIntegrityKeywords .JSONLD_TERM_PROOFPURPOSE , this .proofPurpose );
68+ if (this .previousProof != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , DataIntegrityKeywords .JSONLD_TERM_PREVIOUSPROOF , this .previousProof );
69+ if (this .proofValue != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , DataIntegrityKeywords .JSONLD_TERM_PROOFVALUE , this .proofValue );
70+ if (this .jws != null ) JsonLDUtils .jsonLdAdd (this .jsonLdObject , DataIntegrityKeywords .JSONLD_TERM_JWS , this .jws );
7171
7272 return (DataIntegrityProof ) this .jsonLdObject ;
7373 }
@@ -171,8 +171,8 @@ public static void removeFromJsonLdObject(JsonLDObject jsonLdObject) {
171171 */
172172
173173 public static void removeLdProofValues (JsonLDObject jsonLdObject ) {
174- JsonLDUtils .jsonLdRemove (jsonLdObject , LDSecurityKeywords .JSONLD_TERM_PROOFVALUE );
175- JsonLDUtils .jsonLdRemove (jsonLdObject , LDSecurityKeywords .JSONLD_TERM_JWS );
174+ JsonLDUtils .jsonLdRemove (jsonLdObject , DataIntegrityKeywords .JSONLD_TERM_PROOFVALUE );
175+ JsonLDUtils .jsonLdRemove (jsonLdObject , DataIntegrityKeywords .JSONLD_TERM_JWS );
176176 JsonLDUtils .jsonLdRemove (jsonLdObject , "signatureValue" );
177177 }
178178
@@ -181,46 +181,46 @@ public static void removeLdProofValues(JsonLDObject jsonLdObject) {
181181 */
182182
183183 public String getCryptosuite () {
184- return JsonLDUtils .jsonLdGetString (this .getJsonObject (), LDSecurityKeywords .JSONLD_TERM_CRYPTOSUITE );
184+ return JsonLDUtils .jsonLdGetString (this .getJsonObject (), DataIntegrityKeywords .JSONLD_TERM_CRYPTOSUITE );
185185 }
186186
187187 public Date getCreated () {
188- return JsonLDUtils .stringToDate (JsonLDUtils .jsonLdGetString (this .getJsonObject (), LDSecurityKeywords .JSONLD_TERM_CREATED ));
188+ return JsonLDUtils .stringToDate (JsonLDUtils .jsonLdGetString (this .getJsonObject (), DataIntegrityKeywords .JSONLD_TERM_CREATED ));
189189 }
190190
191191 public Date getExpires () {
192- return JsonLDUtils .stringToDate (JsonLDUtils .jsonLdGetString (this .getJsonObject (), LDSecurityKeywords .JSONLD_TERM_EXPIRES ));
192+ return JsonLDUtils .stringToDate (JsonLDUtils .jsonLdGetString (this .getJsonObject (), DataIntegrityKeywords .JSONLD_TERM_EXPIRES ));
193193 }
194194
195195 public String getDomain () {
196- return JsonLDUtils .jsonLdGetString (this .getJsonObject (), LDSecurityKeywords .JSONLD_TERM_DOMAIN );
196+ return JsonLDUtils .jsonLdGetString (this .getJsonObject (), DataIntegrityKeywords .JSONLD_TERM_DOMAIN );
197197 }
198198
199199 public String getChallenge () {
200- return JsonLDUtils .jsonLdGetString (this .getJsonObject (), LDSecurityKeywords .JSONLD_TERM_CHALLENGE );
200+ return JsonLDUtils .jsonLdGetString (this .getJsonObject (), DataIntegrityKeywords .JSONLD_TERM_CHALLENGE );
201201 }
202202
203203 public String getNonce () {
204- return JsonLDUtils .jsonLdGetString (this .getJsonObject (), LDSecurityKeywords .JSONLD_TERM_NONCE );
204+ return JsonLDUtils .jsonLdGetString (this .getJsonObject (), DataIntegrityKeywords .JSONLD_TERM_NONCE );
205205 }
206206
207207 public URI getVerificationMethod () {
208- return JsonLDUtils .stringToUri (JsonLDUtils .jsonLdGetString (this .getJsonObject (), LDSecurityKeywords .JSONLD_TERM_VERIFICATIONMETHOD ));
208+ return JsonLDUtils .stringToUri (JsonLDUtils .jsonLdGetString (this .getJsonObject (), DataIntegrityKeywords .JSONLD_TERM_VERIFICATIONMETHOD ));
209209 }
210210
211211 public String getProofPurpose () {
212- return JsonLDUtils .jsonLdGetString (this .getJsonObject (), LDSecurityKeywords .JSONLD_TERM_PROOFPURPOSE );
212+ return JsonLDUtils .jsonLdGetString (this .getJsonObject (), DataIntegrityKeywords .JSONLD_TERM_PROOFPURPOSE );
213213 }
214214
215215 public String getPreviousProof () {
216- return JsonLDUtils .jsonLdGetString (this .getJsonObject (), LDSecurityKeywords .JSONLD_TERM_PREVIOUSPROOF );
216+ return JsonLDUtils .jsonLdGetString (this .getJsonObject (), DataIntegrityKeywords .JSONLD_TERM_PREVIOUSPROOF );
217217 }
218218
219219 public String getProofValue () {
220- return JsonLDUtils .jsonLdGetString (this .getJsonObject (), LDSecurityKeywords .JSONLD_TERM_PROOFVALUE );
220+ return JsonLDUtils .jsonLdGetString (this .getJsonObject (), DataIntegrityKeywords .JSONLD_TERM_PROOFVALUE );
221221 }
222222
223223 public String getJws () {
224- return JsonLDUtils .jsonLdGetString (this .getJsonObject (), LDSecurityKeywords .JSONLD_TERM_JWS );
224+ return JsonLDUtils .jsonLdGetString (this .getJsonObject (), DataIntegrityKeywords .JSONLD_TERM_JWS );
225225 }
226226}
0 commit comments