Typedefs | |
typedef int(* | DgnSignatureScanCallback )(DgnModelRefP modelRef, ElementRefP sigel, const DsigDigitalSignature *dsig, CallbackArgP callbackArg) |
Callback for scanning digital signatures. More... | |
Functions | |
ElementRefP | dgnDigitalSignature_addFileSignatureElement (DgnFileP file) |
Creates a cell element that can be used to to create a digital signature with file scope. More... | |
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. More... | |
StatusInt | dgnDigitalSignature_extractFromElementEx (DsigDigitalSignature *sig, ULong32 *sigsz, bool *expired, MSElementCP el, ULong32 maxsz) |
Query the digital signature data associated with the specified element. More... | |
StatusInt | dgnDigitalSignature_extractEx (DsigDigitalSignature *sig, ULong32 *sigsz, bool *expired, ElementRefP ref, ULong32 maxsz) |
Query the digital signature data associated with the specified element. More... | |
Public StatusInt | dgnDigitalSignature_getPrerequisitesFromElement (ElementRefP *prereqs, UInt16 *nprereqs, DgnModelRefP modelref, MSElementCP sigel) |
Query the signatures on which this signature depends. More... | |
StatusInt | dgnDigitalSignature_getPrerequisites (ElementRefP *prereqs, UInt16 *nprereqs, ElementRefP sigel) |
Query the signatures on which this signature depends. More... | |
StatusInt | dgnDigitalSignature_verifyFromElement (DgnModelP cache, MSElementDescrCP sigel) |
Verify a digital signature. More... | |
StatusInt | dgnDigitalSignature_verify (ElementRefP ref) |
Verify a digital signature. More... | |
DONTINCLUDEINDOC bool | dgnDigitalSignature_isSigner (ElementRefP sigel) |
Query if the currently logged in user owns the certificate that was used to create this digital signature. More... | |
StatusInt | dgnDigitalSignature_scanModelSignatures (DgnModelRefP modelRef, DgnSignatureScanCallback callbackFunc, CallbackArgP callbackArg) |
Detect all model signatures in the specified model. More... | |
StatusInt | dgnDigitalSignature_scanFileSignatures (DgnFileP file, DgnSignatureScanCallback callbackFunc, CallbackArgP callbackArg) |
Detect all file signatures in the specified file. More... | |
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 model, and apply recursively to all references attached to this model. More... | |
bool | dgnDigitalSignature_areAllApplicableSignaturesVerified (UInt32 *trustproblems, DgnModelRefP rootmodel) |
Query if all applicable signatures are verified. More... | |
bool | dgnDigitalSignature_areAllApplicableSignaturesVerifiedEx (size_t *signatureCount, UInt32 *trustproblems, DgnModelRefP model) |
Query if all applicable signatures are verified. More... | |
The DGN Digital Signature API allows MDL and native code applications to create and manage digital signatures in V8 design files.
typedef int(* DgnSignatureScanCallback)(DgnModelRefP modelRef, ElementRefP sigel, const DsigDigitalSignature *dsig, CallbackArgP callbackArg) |
Callback for scanning digital signatures.
[in] | modelRef | a signature element |
[in] | sigel | a signature element |
[in] | dsig | digital signature data associted with this element |
[in] | callbackArg | additional callback argument passed to dgnDigitalSignature_scanSignatures |
ElementRefP dgnDigitalSignature_addFileSignatureElement | ( | DgnFileP | file | ) |
Creates a cell element that can be used to to create a digital signature with file scope.
[in] | file | file that will be signed |
bool dgnDigitalSignature_areAllApplicableSignaturesVerified | ( | UInt32 * | trustproblems, |
DgnModelRefP | rootmodel | ||
) |
Query if all applicable signatures are verified.
[in] | rootmodel | the model to scan for signatures and references |
[out] | trustproblems | [optional] CERTIFICATE_QUERY_TRUST_... if certificate is flawed | 0x80000000 if signature is expired |
bool dgnDigitalSignature_areAllApplicableSignaturesVerifiedEx | ( | size_t * | signatureCount, |
UInt32 * | trustproblems, | ||
DgnModelRefP | model | ||
) |
Query if all applicable signatures are verified.
[in] | model | the model to scan for signatures and references |
[out] | signatureCount | [optional] The number of applicable signatures found. |
[out] | trustproblems | [optional] CERTIFICATE_QUERY_TRUST_... if certificate is flawed | 0x80000000 if signature is expired |
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.
This function normally creates signatures with model scope. The element should previously have been added to the model which is being signed.
If the element was created using dgnDigitalSignature_addFileSignatureElement, then it will become a signature with file scope.
The element is modified and rewritten directly to the file. This conversion is not undoable.
The caller can make the signature "hidden" by setting the element's hdr.dhdr.props.b.invisible flag before calling this function.
Note The element must be a cell. The element can contain any graphic and non-graphic components that you wish. The element can have any user data linkages that you wish. All components and user data linkages are included in the signature (i.e., they become tamper-evident).
This function can be used to create new signatures and to recreate existing signatures. If the element is already a digital signature, then the current signature data is removed and is replaced by new signature data.
[in,out] | refP | IN: element to represent the signature; OUT: augmented to represent a digital signature |
[in] | certcc | copy of signer's digital certificate |
[in] | name | informal name of signer (optional, annotation purposes only) |
[in] | purpose | intended purpose of signature (optional, annotation purposes only) |
[in] | location | computer or location of signer (optional, annotation purposes only) |
[in] | expiry | time at which signature should become invalid or 0 for no expiry |
[in] | __reserved1 | reserved for future use. Must be zero. |
[in] | prereqs | signature(s) required by this signature |
[in] | nprereqs | number of signature(s) required by this signature |
[in] | scope | DIGITAL_SIGNATURE_SCOPE_FILE_FLAG to include all of the content of the file that contains sigEh (this is implied when element is in dictionary model), DIGITAL_SIGNATURE_SCOPE_MODEL_FLAG to include the content of the model that contains sigEh DIGITAL_SIGNATURE_SCOPE_REFERENCES_FLAG to include the content of the model and all referenced models |
StatusInt dgnDigitalSignature_extractEx | ( | DsigDigitalSignature * | sig, |
ULong32 * | sigsz, | ||
bool * | expired, | ||
ElementRefP | ref, | ||
ULong32 | maxsz | ||
) |
Query the digital signature data associated with the specified element.
[out] | sig | optional: digital signature data |
[out] | sigsz | optional: size in bytes of signature data that was or would be extracted |
[out] | expired | optional: set to true if signature is found and is expired |
[in] | ref | element to query |
[in] | maxsz | max number bytes to copy into sig |
StatusInt dgnDigitalSignature_extractFromElementEx | ( | DsigDigitalSignature * | sig, |
ULong32 * | sigsz, | ||
bool * | expired, | ||
MSElementCP | el, | ||
ULong32 | maxsz | ||
) |
Query the digital signature data associated with the specified element.
Use the digitalSignature_getInfo function to query the signature data.
[out] | sig | optional: digital signature data |
[out] | sigsz | optional: size of digital signature |
[out] | expired | optional: set to true if signature is found and is expired |
[in] | el | element to query |
[in] | maxsz | max number bytes to copy into sig |
StatusInt dgnDigitalSignature_getPrerequisites | ( | ElementRefP * | prereqs, |
UInt16 * | nprereqs, | ||
ElementRefP | sigel | ||
) |
Query the signatures on which this signature depends.
To query how many prerequisites this signature has, call this function passing NULL for prereqs and the address of an integer for nprereqs. If the return value is SUCCESS, the number of prerequisites will be stored in *nprereqs.
To query the prerequisites, pass the address of the output buffer in prereqs and the address of the count in nprereqs. On input, the value pointed to by nprereqs should be the maximum number of items that prereqs can hold. On return, the count value will be changed to the number of items actually copied into prereqs.
[out] | prereqs | optional: prerequisite signature elements |
[in,out] | nprereqs | optional: IN: max # elements to return; OUT: # prerequisites |
[in] | sigel | signature element to query |
Public StatusInt dgnDigitalSignature_getPrerequisitesFromElement | ( | ElementRefP * | prereqs, |
UInt16 * | nprereqs, | ||
DgnModelRefP | modelref, | ||
MSElementCP | sigel | ||
) |
Query the signatures on which this signature depends.
To query how many prerequisites this signature has, call this function passing NULL for prereqs and the address of an integer for nprereqs. If the return value is SUCCESS, the number of prerequisites will be stored in *nprereqs.
To query the prerequisites, pass the address of the output buffer in prereqs and the address of the count in nprereqs. On input, the value pointed to by nprereqs should be the maximum number of items that prereqs can hold. On return, the count value will be changed to the number of items actually copied into prereqs.
[out] | prereqs | optional: prerequisite signature elements |
[in,out] | nprereqs | optional: IN: max # elements to return; OUT: # prerequisites |
[in] | modelref | model containing signature element |
[in] | sigel | signature element to query |
DONTINCLUDEINDOC bool dgnDigitalSignature_isSigner | ( | ElementRefP | sigel | ) |
Query if the currently logged in user owns the certificate that was used to create this digital signature.
[in] | sigel | signature element to test |
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 model, and apply recursively to all references attached to this model.
Only signatures with model scope in the specified model are processed.
Use the digitalSignature_getInfo function to query the signature data.
[in] | rootmodel | the model to scan for signatures and references |
[in] | callbackFunc | callback function to invoke on each signature in scope |
[in] | callbackArg | additional callback argument passed to dgnDigitalSignature_scanSignatures |
StatusInt dgnDigitalSignature_scanFileSignatures | ( | DgnFileP | file, |
DgnSignatureScanCallback | callbackFunc, | ||
CallbackArgP | callbackArg | ||
) |
Detect all file signatures in the specified file.
Only signatures with file scope in the specified file are processed.
Use the digitalSignature_getInfo function to query the signature data.
[in] | file | the file to scan for signatures |
[in] | callbackFunc | callback function to invoke on each signature in scope |
[in] | callbackArg | additional callback argument passed to dgnDigitalSignature_scanSignatures |
StatusInt dgnDigitalSignature_scanModelSignatures | ( | DgnModelRefP | modelRef, |
DgnSignatureScanCallback | callbackFunc, | ||
CallbackArgP | callbackArg | ||
) |
Detect all model signatures in the specified model.
Only signatures with model scope in the specified model are processed.
Use the digitalSignature_getInfo function to query the signature data.
[in] | modelRef | the model to scan for signatures |
[in] | callbackFunc | callback function to invoke on each signature in scope |
[in] | callbackArg | additional callback argument passed to dgnDigitalSignature_scanSignatures |
StatusInt dgnDigitalSignature_verify | ( | ElementRefP | ref | ) |
Verify a digital signature.
[in] | ref | signature element to test |
StatusInt dgnDigitalSignature_verifyFromElement | ( | DgnModelP | cache, |
MSElementDescrCP | sigel | ||
) |
Verify a digital signature.
[in] | cache | cache containing the signature |
[in] | sigel | signature element to test |