dgnsignature.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 
11 #include "mstypes.h"
12 #include "mselems.h"
13 #include <RmgrTools\Tools\Dsig.h>
14 
16 
28 /*----------------------------------------------------------------------**/
42 (
43 DgnFileP file
44 );
45 
46 /*----------------------------------------------------------------------**/
86 (
87 ElementRefP* refP,
88 const DsigCertificate* certcc,
89 const WChar* name,
90 const WChar* purpose,
91 const WChar* location,
92 double expiry,
93 int __reserved1,
94 ElementRefP* prereqs,
95 UInt16 nprereqs,
96 UInt32 scope
97 );
98 
99 /*----------------------------------------------------------------------**/
132 (
133 DsigDigitalSignature* sig,
134 ULong32* sigsz,
135 bool* expired,
136 MSElementCP el,
137 ULong32 maxsz
138 );
139 
140 /*----------------------------------------------------------------------**/
170 (
171 DsigDigitalSignature* sig,
172 ULong32* sigsz,
173 bool* expired,
174 ElementRefP ref,
175 ULong32 maxsz
176 );
177 
178 /*----------------------------------------------------------------------**/
201 (
202 ElementRefP* prereqs,
203 UInt16* nprereqs,
204 DgnModelRefP modelref,
205 MSElementCP sigel
206 );
207 
208 /*----------------------------------------------------------------------**/
231 ( // <= SUCCESS if signature has prerequisites
232 ElementRefP* prereqs, // <= optional: prerequisite signature elements
233 UInt16* nprereqs, // <=> optional: IN: max # elements to return; OUT: # prerequisites
234 ElementRefP sigel // => signature element to query
235 );
236 
237 /*----------------------------------------------------------------------**/
252 (
253 DgnModelP cache,
254 MSElementDescrCP sigel
255 );
256 
257 /*----------------------------------------------------------------------**/
271 ( // <= SUCCESS if signature is verified
272 ElementRefP ref // => the signature element
273 );
274 
276 
277 /*---------------------------------------------------------------------------------**/
280 typedef void DgnDigitalSignatureVerifyCellDefinitionCallback
281 (
282 DgnModelRefP modelRef,
283 ElementRefP sigel,
284 DsigDigitalSignature const* sig,
285 CallbackArgP arg
286 );
287 
288 /*----------------------------------------------------------------------**/
299 MSCORE_EXPORT StatusInt dgnDigitalSignature_verifyCellDefinitionEx
300 (
301 DgnFileP cellLibrary,
302 const WChar* cellName,
303 bool allowExpired,
304 DgnDigitalSignatureVerifyCellDefinitionCallback* cb,
305 CallbackArgP cbarg
306 );
307 
309 
310 /*----------------------------------------------------------------------**/
322 MSCORE_EXPORT bool dgnDigitalSignature_isSigner
323 (
324 ElementRefP sigel
325 );
326 
327 /*----------------------------------------------------------------------**/
339 typedef int (*DgnSignatureScanCallback)
340 (
341 DgnModelRefP modelRef,
342 ElementRefP sigel,
343 const DsigDigitalSignature* dsig,
344 CallbackArgP callbackArg
345 );
346 
347 /*----------------------------------------------------------------------**/
366 (
367 DgnModelRefP modelRef,
368 DgnSignatureScanCallback callbackFunc,
369 CallbackArgP callbackArg
370 );
371 
372 /*----------------------------------------------------------------------**/
391 (
392 DgnFileP file,
393 DgnSignatureScanCallback callbackFunc,
394 CallbackArgP callbackArg
395 );
396 
397 /*----------------------------------------------------------------------**/
423 (
424 DgnModelRefP rootmodel,
425 DgnSignatureScanCallback callbackFunc,
426 CallbackArgP callbackArg
427 );
428 
429 /*----------------------------------------------------------------------**/
439 (
440 UInt32* trustproblems,
441 DgnModelRefP rootmodel
442 );
443 
444 /*----------------------------------------------------------------------**/
455 (
456 size_t* signatureCount, // <= [optional] The number of applicable signatures found.
457 UInt32* trustproblems, // <= [optional] 0: no problems | CERTIFICATE_QUERY_TRUST_... if certificate is flawed | 0x80000000 if signature expired
458 DgnModelRefP model // <= the model to scan for signatures and references
459 );
460 
463 
StatusInt dgnDigitalSignature_scanApplicableSignatures(DgnModelRefP rootmodel, DgnSignatureScanCallback callbackFunc, CallbackArgP callbackArg)
Detect all model signatures in the specified model, all file signatures in the file containing the mo...
StatusInt dgnDigitalSignature_verify(ElementRefP ref)
Verify a digital signature.
#define Public
Definition: Bentley.h:161
wchar_t WChar
Definition: Bentley.h:223
StatusInt dgnDigitalSignature_getPrerequisites(ElementRefP *prereqs, UInt16 *nprereqs, ElementRefP sigel)
Query the signatures on which this signature depends.
uint16_t UInt16
Definition: Bentley.r.h:118
Public StatusInt dgnDigitalSignature_getPrerequisitesFromElement(ElementRefP *prereqs, UInt16 *nprereqs, DgnModelRefP modelref, MSElementCP sigel)
Query the signatures on which this signature depends.
unsigned long ULong32
Definition: Bentley.r.h:146
bool dgnDigitalSignature_areAllApplicableSignaturesVerified(UInt32 *trustproblems, DgnModelRefP rootmodel)
Query if all applicable signatures are verified.
uint32_t UInt32
Definition: Bentley.r.h:128
struct DgnPlatform::MSElementDescr const * MSElementDescrCP
Definition: DgnPlatform.h:390
bool dgnDigitalSignature_areAllApplicableSignaturesVerifiedEx(size_t *signatureCount, UInt32 *trustproblems, DgnModelRefP model)
Query if all applicable signatures are verified.
struct DgnPlatform::DgnModel * DgnModelP
Definition: DgnPlatform.h:220
struct DgnPlatform::DgnFile * DgnFileP
Definition: DgnPlatform.h:206
StatusInt dgnDigitalSignature_scanModelSignatures(DgnModelRefP modelRef, DgnSignatureScanCallback callbackFunc, CallbackArgP callbackArg)
Detect all model signatures in the specified model.
#define BEGIN_EXTERN_C
Definition: Bentley.h:164
StatusInt dgnDigitalSignature_verifyFromElement(DgnModelP cache, MSElementDescrCP sigel)
Verify a digital signature.
ElementRefP dgnDigitalSignature_addFileSignatureElement(DgnFileP file)
Creates a cell element that can be used to to create a digital signature with file scope...
StatusInt dgnDigitalSignature_scanFileSignatures(DgnFileP file, DgnSignatureScanCallback callbackFunc, CallbackArgP callbackArg)
Detect all file signatures in the specified file.
#define END_EXTERN_C
Definition: Bentley.h:165
int StatusInt
Definition: Bentley.h:222
struct DgnPlatform::ElementRefBase * ElementRefP
Definition: DgnPlatform.h:166
void * CallbackArgP
Definition: Bentley.h:235
StatusInt dgnDigitalSignature_create(ElementRefP *refP, const DsigCertificate *certcc, const WChar *name, const WChar *purpose, const WChar *location, double expiry, int __reserved1, ElementRefP *prereqs, UInt16 nprereqs, UInt32 scope)
Converts a cell element into a digital signature.
StatusInt dgnDigitalSignature_extractEx(DsigDigitalSignature *sig, ULong32 *sigsz, bool *expired, ElementRefP ref, ULong32 maxsz)
Query the digital signature data associated with the specified element.
StatusInt dgnDigitalSignature_extractFromElementEx(DsigDigitalSignature *sig, ULong32 *sigsz, bool *expired, MSElementCP el, ULong32 maxsz)
Query the digital signature data associated with the specified element.
DONTINCLUDEINDOC bool dgnDigitalSignature_isSigner(ElementRefP sigel)
Query if the currently logged in user owns the certificate that was used to create this digital signa...
struct DgnPlatform::DgnModelRef * DgnModelRefP
Definition: DgnPlatform.h:223
union DgnPlatform::MSElement const * MSElementCP
Definition: DgnPlatform.h:531
int(* DgnSignatureScanCallback)(DgnModelRefP modelRef, ElementRefP sigel, const DsigDigitalSignature *dsig, CallbackArgP callbackArg)
Callback for scanning digital signatures.
Definition: dgnsignature.h:340

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.