package rdf

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file security.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
(*********************************************************************************)
(*                OCaml-RDF                                                      *)
(*                                                                               *)
(*    Copyright (C) 2012-2024 Institut National de Recherche en Informatique     *)
(*    et en Automatique. All rights reserved.                                    *)
(*                                                                               *)
(*    This program is free software; you can redistribute it and/or modify       *)
(*    it under the terms of the GNU Lesser General Public License version        *)
(*    3 as published by the Free Software Foundation.                            *)
(*                                                                               *)
(*    This program is distributed in the hope that it will be useful,            *)
(*    but WITHOUT ANY WARRANTY; without even the implied warranty of             *)
(*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *)
(*    GNU General Public License for more details.                               *)
(*                                                                               *)
(*    You should have received a copy of the GNU General Public License          *)
(*    along with this program; if not, write to the Free Software                *)
(*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA                   *)
(*    02111-1307  USA                                                            *)
(*                                                                               *)
(*    Contact: Maxence.Guesdon@inria.fr                                          *)
(*                                                                               *)
(*********************************************************************************)

let security_str = "https://w3id.org/security#";;
let security = Iri.of_string security_str ;;
let security_ s = Iri.of_string (security_str ^ s);;

let c_BbsBlsSignature2020 = security_ "BbsBlsSignature2020" ;;
let c_BbsBlsSignatureProof2020 = security_ "BbsBlsSignatureProof2020" ;;
let c_Bls12381G1Key2020 = security_ "Bls12381G1Key2020" ;;
let c_Bls12381G2Key2020 = security_ "Bls12381G2Key2020" ;;
let c_DataIntegrityProof = security_ "DataIntegrityProof" ;;
let c_Digest = security_ "Digest" ;;
let c_EcdsaSecp256k1RecoveryMethod2020 = security_ "EcdsaSecp256k1RecoveryMethod2020" ;;
let c_EcdsaSecp256k1RecoverySignature2020 = security_ "EcdsaSecp256k1RecoverySignature2020" ;;
let c_EcdsaSecp256k1Signature2019 = security_ "EcdsaSecp256k1Signature2019" ;;
let c_EcdsaSecp256k1Signature2020 = security_ "EcdsaSecp256k1Signature2020" ;;
let c_EcdsaSecp256k1VerificationKey2019 = security_ "EcdsaSecp256k1VerificationKey2019" ;;
let c_Ed25519Signature2020 = security_ "Ed25519Signature2020" ;;
let c_Ed25519VerificationKey2018 = security_ "Ed25519VerificationKey2018" ;;
let c_Ed25519VerificationKey2020 = security_ "Ed25519VerificationKey2020" ;;
let c_EncryptedMessage = security_ "EncryptedMessage" ;;
let c_GraphSignature2012 = security_ "GraphSignature2012" ;;
let c_JsonWebKey2020 = security_ "JsonWebKey2020" ;;
let c_JsonWebSignature2020 = security_ "JsonWebSignature2020" ;;
let c_Key = security_ "Key" ;;
let c_LinkedDataSignature2015 = security_ "LinkedDataSignature2015" ;;
let c_LinkedDataSignature2016 = security_ "LinkedDataSignature2016" ;;
let c_MerkleProof2019 = security_ "MerkleProof2019" ;;
let c_Multikey = security_ "Multikey" ;;
let c_Proof = security_ "Proof" ;;
let c_ProofGraph = security_ "ProofGraph" ;;
let c_RsaSignature2018 = security_ "RsaSignature2018" ;;
let c_RsaVerificationKey2018 = security_ "RsaVerificationKey2018" ;;
let c_SchnorrSecp256k1Signature2019 = security_ "SchnorrSecp256k1Signature2019" ;;
let c_SchnorrSecp256k1VerificationKey2019 = security_ "SchnorrSecp256k1VerificationKey2019" ;;
let c_ServiceEndpointProxyService = security_ "ServiceEndpointProxyService" ;;
let c_Signature = security_ "Signature" ;;
let c_SignatureGraph = security_ "SignatureGraph" ;;
let c_VerificationMethod = security_ "VerificationMethod" ;;
let c_X25519KeyAgreementKey2019 = security_ "X25519KeyAgreementKey2019" ;;
let allowedAction = security_ "allowedAction" ;;
let blockchainAccountId = security_ "blockchainAccountId" ;;
let canonicalizationAlgorithm = security_ "canonicalizationAlgorithm" ;;
let capabilityAction = security_ "capabilityAction" ;;
let capabilityChain = security_ "capabilityChain" ;;
let caveat = security_ "caveat" ;;
let challenge = security_ "challenge" ;;
let cipherAlgorithm = security_ "cipherAlgorithm" ;;
let cipherData = security_ "cipherData" ;;
let cipherKey = security_ "cipherKey" ;;
let controller = security_ "controller" ;;
let cryptosuite = security_ "cryptosuite" ;;
let delegator = security_ "delegator" ;;
let digestAlgorithm = security_ "digestAlgorithm" ;;
let digestValue = security_ "digestValue" ;;
let domain = security_ "domain" ;;
let ethereumAddress = security_ "ethereumAddress" ;;
let expirationDate = security_ "expirationDate" ;;
let expires = security_ "expires" ;;
let initializationVector = security_ "initializationVector" ;;
let invocationTarget = security_ "invocationTarget" ;;
let invoker = security_ "invoker" ;;
let jws = security_ "jws" ;;
let nonce = security_ "nonce" ;;
let owner = security_ "owner" ;;
let password = security_ "password" ;;
let privateKeyPem = security_ "privateKeyPem" ;;
let proofPurpose = security_ "proofPurpose" ;;
let proofValue = security_ "proofValue" ;;
let publicKey = security_ "publicKey" ;;
let publicKeyBase58 = security_ "publicKeyBase58" ;;
let publicKeyHex = security_ "publicKeyHex" ;;
let publicKeyJwk = security_ "publicKeyJwk" ;;
let publicKeyMultibase = security_ "publicKeyMultibase" ;;
let publicKeyPem = security_ "publicKeyPem" ;;
let publicKeyService = security_ "publicKeyService" ;;
let revoked = security_ "revoked" ;;
let service = security_ "service" ;;
let serviceEndpoint = security_ "serviceEndpoint" ;;
let signature = security_ "signature" ;;
let signatureAlgorithm = security_ "signatureAlgorithm" ;;
let signatureValue = security_ "signatureValue" ;;
let x509CertificateChain = security_ "x509CertificateChain" ;;
let x509CertificateFingerprint = security_ "x509CertificateFingerprint" ;;

module Open = struct
  let security_c_BbsBlsSignature2020 = c_BbsBlsSignature2020
  let security_c_BbsBlsSignatureProof2020 = c_BbsBlsSignatureProof2020
  let security_c_Bls12381G1Key2020 = c_Bls12381G1Key2020
  let security_c_Bls12381G2Key2020 = c_Bls12381G2Key2020
  let security_c_DataIntegrityProof = c_DataIntegrityProof
  let security_c_Digest = c_Digest
  let security_c_EcdsaSecp256k1RecoveryMethod2020 = c_EcdsaSecp256k1RecoveryMethod2020
  let security_c_EcdsaSecp256k1RecoverySignature2020 = c_EcdsaSecp256k1RecoverySignature2020
  let security_c_EcdsaSecp256k1Signature2019 = c_EcdsaSecp256k1Signature2019
  let security_c_EcdsaSecp256k1Signature2020 = c_EcdsaSecp256k1Signature2020
  let security_c_EcdsaSecp256k1VerificationKey2019 = c_EcdsaSecp256k1VerificationKey2019
  let security_c_Ed25519Signature2020 = c_Ed25519Signature2020
  let security_c_Ed25519VerificationKey2018 = c_Ed25519VerificationKey2018
  let security_c_Ed25519VerificationKey2020 = c_Ed25519VerificationKey2020
  let security_c_EncryptedMessage = c_EncryptedMessage
  let security_c_GraphSignature2012 = c_GraphSignature2012
  let security_c_JsonWebKey2020 = c_JsonWebKey2020
  let security_c_JsonWebSignature2020 = c_JsonWebSignature2020
  let security_c_Key = c_Key
  let security_c_LinkedDataSignature2015 = c_LinkedDataSignature2015
  let security_c_LinkedDataSignature2016 = c_LinkedDataSignature2016
  let security_c_MerkleProof2019 = c_MerkleProof2019
  let security_c_Multikey = c_Multikey
  let security_c_Proof = c_Proof
  let security_c_ProofGraph = c_ProofGraph
  let security_c_RsaSignature2018 = c_RsaSignature2018
  let security_c_RsaVerificationKey2018 = c_RsaVerificationKey2018
  let security_c_SchnorrSecp256k1Signature2019 = c_SchnorrSecp256k1Signature2019
  let security_c_SchnorrSecp256k1VerificationKey2019 = c_SchnorrSecp256k1VerificationKey2019
  let security_c_ServiceEndpointProxyService = c_ServiceEndpointProxyService
  let security_c_Signature = c_Signature
  let security_c_SignatureGraph = c_SignatureGraph
  let security_c_VerificationMethod = c_VerificationMethod
  let security_c_X25519KeyAgreementKey2019 = c_X25519KeyAgreementKey2019
  let security_allowedAction = allowedAction
  let security_blockchainAccountId = blockchainAccountId
  let security_canonicalizationAlgorithm = canonicalizationAlgorithm
  let security_capabilityAction = capabilityAction
  let security_capabilityChain = capabilityChain
  let security_caveat = caveat
  let security_challenge = challenge
  let security_cipherAlgorithm = cipherAlgorithm
  let security_cipherData = cipherData
  let security_cipherKey = cipherKey
  let security_controller = controller
  let security_cryptosuite = cryptosuite
  let security_delegator = delegator
  let security_digestAlgorithm = digestAlgorithm
  let security_digestValue = digestValue
  let security_domain = domain
  let security_ethereumAddress = ethereumAddress
  let security_expirationDate = expirationDate
  let security_expires = expires
  let security_initializationVector = initializationVector
  let security_invocationTarget = invocationTarget
  let security_invoker = invoker
  let security_jws = jws
  let security_nonce = nonce
  let security_owner = owner
  let security_password = password
  let security_privateKeyPem = privateKeyPem
  let security_proofPurpose = proofPurpose
  let security_proofValue = proofValue
  let security_publicKey = publicKey
  let security_publicKeyBase58 = publicKeyBase58
  let security_publicKeyHex = publicKeyHex
  let security_publicKeyJwk = publicKeyJwk
  let security_publicKeyMultibase = publicKeyMultibase
  let security_publicKeyPem = publicKeyPem
  let security_publicKeyService = publicKeyService
  let security_revoked = revoked
  let security_service = service
  let security_serviceEndpoint = serviceEndpoint
  let security_signature = signature
  let security_signatureAlgorithm = signatureAlgorithm
  let security_signatureValue = signatureValue
  let security_x509CertificateChain = x509CertificateChain
  let security_x509CertificateFingerprint = x509CertificateFingerprint
end

class from ?sub g =
  let sub = match sub with None -> Term.Iri (g.Graph.name()) | Some t -> t in
  object(self)
  method allowedAction = g.Graph.objects_of ~sub ~pred: allowedAction
  method allowedAction_opt = match self#allowedAction with [] -> None | x::_ -> Some x
  method allowedAction_iris = Graph.only_iris (self#allowedAction)
  method allowedAction_opt_iri = match self#allowedAction_iris with [] -> None | x::_ -> Some x
  method blockchainAccountId = Graph.literal_objects_of g ~sub ~pred: blockchainAccountId
  method blockchainAccountId_opt = match self#blockchainAccountId with [] -> None | x::_ -> Some x
  method canonicalizationAlgorithm = g.Graph.objects_of ~sub ~pred: canonicalizationAlgorithm
  method canonicalizationAlgorithm_opt = match self#canonicalizationAlgorithm with [] -> None | x::_ -> Some x
  method canonicalizationAlgorithm_iris = Graph.only_iris (self#canonicalizationAlgorithm)
  method canonicalizationAlgorithm_opt_iri = match self#canonicalizationAlgorithm_iris with [] -> None | x::_ -> Some x
  method capabilityAction = g.Graph.objects_of ~sub ~pred: capabilityAction
  method capabilityAction_opt = match self#capabilityAction with [] -> None | x::_ -> Some x
  method capabilityAction_iris = Graph.only_iris (self#capabilityAction)
  method capabilityAction_opt_iri = match self#capabilityAction_iris with [] -> None | x::_ -> Some x
  method capabilityChain = g.Graph.objects_of ~sub ~pred: capabilityChain
  method capabilityChain_opt = match self#capabilityChain with [] -> None | x::_ -> Some x
  method capabilityChain_iris = Graph.only_iris (self#capabilityChain)
  method capabilityChain_opt_iri = match self#capabilityChain_iris with [] -> None | x::_ -> Some x
  method caveat = g.Graph.objects_of ~sub ~pred: caveat
  method caveat_opt = match self#caveat with [] -> None | x::_ -> Some x
  method caveat_iris = Graph.only_iris (self#caveat)
  method caveat_opt_iri = match self#caveat_iris with [] -> None | x::_ -> Some x
  method challenge = Graph.literal_objects_of g ~sub ~pred: challenge
  method challenge_opt = match self#challenge with [] -> None | x::_ -> Some x
  method cipherAlgorithm = Graph.literal_objects_of g ~sub ~pred: cipherAlgorithm
  method cipherAlgorithm_opt = match self#cipherAlgorithm with [] -> None | x::_ -> Some x
  method cipherData = Graph.literal_objects_of g ~sub ~pred: cipherData
  method cipherData_opt = match self#cipherData with [] -> None | x::_ -> Some x
  method cipherKey = Graph.literal_objects_of g ~sub ~pred: cipherKey
  method cipherKey_opt = match self#cipherKey with [] -> None | x::_ -> Some x
  method controller = g.Graph.objects_of ~sub ~pred: controller
  method controller_opt = match self#controller with [] -> None | x::_ -> Some x
  method controller_iris = Graph.only_iris (self#controller)
  method controller_opt_iri = match self#controller_iris with [] -> None | x::_ -> Some x
  method cryptosuite = Graph.literal_objects_of g ~sub ~pred: cryptosuite
  method cryptosuite_opt = match self#cryptosuite with [] -> None | x::_ -> Some x
  method delegator = g.Graph.objects_of ~sub ~pred: delegator
  method delegator_opt = match self#delegator with [] -> None | x::_ -> Some x
  method delegator_iris = Graph.only_iris (self#delegator)
  method delegator_opt_iri = match self#delegator_iris with [] -> None | x::_ -> Some x
  method digestAlgorithm = Graph.literal_objects_of g ~sub ~pred: digestAlgorithm
  method digestAlgorithm_opt = match self#digestAlgorithm with [] -> None | x::_ -> Some x
  method digestValue = Graph.literal_objects_of g ~sub ~pred: digestValue
  method digestValue_opt = match self#digestValue with [] -> None | x::_ -> Some x
  method domain = Graph.literal_objects_of g ~sub ~pred: domain
  method domain_opt = match self#domain with [] -> None | x::_ -> Some x
  method ethereumAddress = Graph.literal_objects_of g ~sub ~pred: ethereumAddress
  method ethereumAddress_opt = match self#ethereumAddress with [] -> None | x::_ -> Some x
  method expirationDate = g.Graph.objects_of ~sub ~pred: expirationDate
  method expirationDate_opt = match self#expirationDate with [] -> None | x::_ -> Some x
  method expirationDate_iris = Graph.only_iris (self#expirationDate)
  method expirationDate_opt_iri = match self#expirationDate_iris with [] -> None | x::_ -> Some x
  method expires = g.Graph.objects_of ~sub ~pred: expires
  method expires_opt = match self#expires with [] -> None | x::_ -> Some x
  method expires_iris = Graph.only_iris (self#expires)
  method expires_opt_iri = match self#expires_iris with [] -> None | x::_ -> Some x
  method initializationVector = Graph.literal_objects_of g ~sub ~pred: initializationVector
  method initializationVector_opt = match self#initializationVector with [] -> None | x::_ -> Some x
  method invocationTarget = g.Graph.objects_of ~sub ~pred: invocationTarget
  method invocationTarget_opt = match self#invocationTarget with [] -> None | x::_ -> Some x
  method invocationTarget_iris = Graph.only_iris (self#invocationTarget)
  method invocationTarget_opt_iri = match self#invocationTarget_iris with [] -> None | x::_ -> Some x
  method invoker = g.Graph.objects_of ~sub ~pred: invoker
  method invoker_opt = match self#invoker with [] -> None | x::_ -> Some x
  method invoker_iris = Graph.only_iris (self#invoker)
  method invoker_opt_iri = match self#invoker_iris with [] -> None | x::_ -> Some x
  method jws = g.Graph.objects_of ~sub ~pred: jws
  method jws_opt = match self#jws with [] -> None | x::_ -> Some x
  method jws_iris = Graph.only_iris (self#jws)
  method jws_opt_iri = match self#jws_iris with [] -> None | x::_ -> Some x
  method nonce = Graph.literal_objects_of g ~sub ~pred: nonce
  method nonce_opt = match self#nonce with [] -> None | x::_ -> Some x
  method owner = g.Graph.objects_of ~sub ~pred: owner
  method owner_opt = match self#owner with [] -> None | x::_ -> Some x
  method owner_iris = Graph.only_iris (self#owner)
  method owner_opt_iri = match self#owner_iris with [] -> None | x::_ -> Some x
  method password = Graph.literal_objects_of g ~sub ~pred: password
  method password_opt = match self#password with [] -> None | x::_ -> Some x
  method privateKeyPem = Graph.literal_objects_of g ~sub ~pred: privateKeyPem
  method privateKeyPem_opt = match self#privateKeyPem with [] -> None | x::_ -> Some x
  method proofPurpose = Graph.literal_objects_of g ~sub ~pred: proofPurpose
  method proofPurpose_opt = match self#proofPurpose with [] -> None | x::_ -> Some x
  method proofValue = Graph.literal_objects_of g ~sub ~pred: proofValue
  method proofValue_opt = match self#proofValue with [] -> None | x::_ -> Some x
  method publicKey = g.Graph.objects_of ~sub ~pred: publicKey
  method publicKey_opt = match self#publicKey with [] -> None | x::_ -> Some x
  method publicKey_iris = Graph.only_iris (self#publicKey)
  method publicKey_opt_iri = match self#publicKey_iris with [] -> None | x::_ -> Some x
  method publicKeyBase58 = Graph.literal_objects_of g ~sub ~pred: publicKeyBase58
  method publicKeyBase58_opt = match self#publicKeyBase58 with [] -> None | x::_ -> Some x
  method publicKeyHex = Graph.literal_objects_of g ~sub ~pred: publicKeyHex
  method publicKeyHex_opt = match self#publicKeyHex with [] -> None | x::_ -> Some x
  method publicKeyJwk = Graph.literal_objects_of g ~sub ~pred: publicKeyJwk
  method publicKeyJwk_opt = match self#publicKeyJwk with [] -> None | x::_ -> Some x
  method publicKeyMultibase = Graph.literal_objects_of g ~sub ~pred: publicKeyMultibase
  method publicKeyMultibase_opt = match self#publicKeyMultibase with [] -> None | x::_ -> Some x
  method publicKeyPem = Graph.literal_objects_of g ~sub ~pred: publicKeyPem
  method publicKeyPem_opt = match self#publicKeyPem with [] -> None | x::_ -> Some x
  method publicKeyService = g.Graph.objects_of ~sub ~pred: publicKeyService
  method publicKeyService_opt = match self#publicKeyService with [] -> None | x::_ -> Some x
  method publicKeyService_iris = Graph.only_iris (self#publicKeyService)
  method publicKeyService_opt_iri = match self#publicKeyService_iris with [] -> None | x::_ -> Some x
  method revoked = g.Graph.objects_of ~sub ~pred: revoked
  method revoked_opt = match self#revoked with [] -> None | x::_ -> Some x
  method revoked_iris = Graph.only_iris (self#revoked)
  method revoked_opt_iri = match self#revoked_iris with [] -> None | x::_ -> Some x
  method service = g.Graph.objects_of ~sub ~pred: service
  method service_opt = match self#service with [] -> None | x::_ -> Some x
  method service_iris = Graph.only_iris (self#service)
  method service_opt_iri = match self#service_iris with [] -> None | x::_ -> Some x
  method serviceEndpoint = g.Graph.objects_of ~sub ~pred: serviceEndpoint
  method serviceEndpoint_opt = match self#serviceEndpoint with [] -> None | x::_ -> Some x
  method serviceEndpoint_iris = Graph.only_iris (self#serviceEndpoint)
  method serviceEndpoint_opt_iri = match self#serviceEndpoint_iris with [] -> None | x::_ -> Some x
  method signature = g.Graph.objects_of ~sub ~pred: signature
  method signature_opt = match self#signature with [] -> None | x::_ -> Some x
  method signature_iris = Graph.only_iris (self#signature)
  method signature_opt_iri = match self#signature_iris with [] -> None | x::_ -> Some x
  method signatureAlgorithm = g.Graph.objects_of ~sub ~pred: signatureAlgorithm
  method signatureAlgorithm_opt = match self#signatureAlgorithm with [] -> None | x::_ -> Some x
  method signatureAlgorithm_iris = Graph.only_iris (self#signatureAlgorithm)
  method signatureAlgorithm_opt_iri = match self#signatureAlgorithm_iris with [] -> None | x::_ -> Some x
  method signatureValue = Graph.literal_objects_of g ~sub ~pred: signatureValue
  method signatureValue_opt = match self#signatureValue with [] -> None | x::_ -> Some x
  method x509CertificateChain = g.Graph.objects_of ~sub ~pred: x509CertificateChain
  method x509CertificateChain_opt = match self#x509CertificateChain with [] -> None | x::_ -> Some x
  method x509CertificateChain_iris = Graph.only_iris (self#x509CertificateChain)
  method x509CertificateChain_opt_iri = match self#x509CertificateChain_iris with [] -> None | x::_ -> Some x
  method x509CertificateFingerprint = g.Graph.objects_of ~sub ~pred: x509CertificateFingerprint
  method x509CertificateFingerprint_opt = match self#x509CertificateFingerprint with [] -> None | x::_ -> Some x
  method x509CertificateFingerprint_iris = Graph.only_iris (self#x509CertificateFingerprint)
  method x509CertificateFingerprint_opt_iri = match self#x509CertificateFingerprint_iris with [] -> None | x::_ -> Some x
  end
OCaml

Innovation. Community. Security.