DigitalSignatureCellHeaderHandler.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 "CellHeaderHandler.h"
12 #include <RmgrTools/Tools/Dsig.h>
13 #include <Bentley/bvector.h>
14 
16 
45 /*=================================================================================**/
87  ITextEdit
88 {
91 private:
92  virtual void MakeClassAbstract() = 0;
93 public:
94 public:
95 
96 /*=================================================================================**/
104 {
106 
108  DigitalSignatureData (ElementHandleCR, DsigDigitalSignature const&);
109 
110 public:
112 
113 }; // DigitalSignatureData
114 
117 
118 /*---------------------------------------------------------------------------------**/
168 DGNPLATFORM_EXPORT static StatusInt ConvertToSignatureElement
169 (
170 EditElementHandleR sigEh,
171 byte const* x509Cert,
172 ULong32 x509CertSz,
173 bool includeReferences = false,
174 ElementAgenda const& prereqs = ElementAgenda(),
175 DsigAnnotationData const& annotations = DsigAnnotationData(),
176 bool includeCertChain = true
177 );
178 
180 
183 
184 /*---------------------------------------------------------------------------------**/
195 DGNPLATFORM_EXPORT static StatusInt Verify (ElementRefP sigref);
196 
197 /*----------------------------------------------------------------------**/
204 DGNPLATFORM_EXPORT static StatusInt GetPrerequisites
205 (
206 ElementAgenda& prereqs,
207 ElementHandleCR sigel
208 );
209 
210 /*---------------------------------------------------------------------------------**/
218 
220 
223 
224 
225 }; // DigitalSignatureCellHeaderHandler
226 
230 
231 /*=================================================================================**/
237 struct DigitalSignatureIterator : std::iterator<std::forward_iterator_tag, ElementHandle const>
238 {
239 private:
241  ElementHandle m_eh;
242 
243  void ToSignature ();
244  void SetElmList (PersistentElementRefList*);
246 DGNPLATFORM_EXPORT DigitalSignatureIterator ();
247 
248  bool IsValid () const;
249 
250  friend struct FileSignatureCollection;
253 
254 public:
255 DGNPLATFORM_EXPORT DigitalSignatureIterator& operator++();
256 DGNPLATFORM_EXPORT bool operator==(DigitalSignatureIterator const&) const;
257 DGNPLATFORM_EXPORT bool operator!=(DigitalSignatureIterator const&) const;
258 
262 
263 }; // DigitalSignatureIterator
264 
265 /*=================================================================================**/
281 {
282 private:
283  DgnFileR m_file;
284 
285 public:
288 
289  FileSignatureCollection (DgnFileR f) : m_file(f) {;}
290 
291  DigitalSignatureIterator begin () const {return DigitalSignatureIterator (m_file.GetDictionaryModel().GetControlElementsP());}
293 
294 }; // FileSignatureCollection
295 
296 /*=================================================================================**/
312 {
313 private:
314  DgnModelR m_model;
315 
316 public:
319 
320  ModelSignatureCollection (DgnModelR c) : m_model(c) {;}
321 
322  DigitalSignatureIterator begin () const {return DigitalSignatureIterator (m_model.GetGraphicElementsP());}
324 
325 }; // ModelSignatureCollection
326 
327 /*=================================================================================**/
346 {
347 private:
348  DgnModelR m_model;
349 
350 public:
351  struct const_iterator : std::iterator<std::forward_iterator_tag, ElementHandle const>
352  {
353  private:
355 
356  bvector<PersistentElementRefList*> m_elmlists;
357  size_t m_elmlistPos;
358  DigitalSignatureIterator m_sigit;
359 
361 
362  public:
363 DGNPLATFORM_EXPORT const_iterator& operator++();
365 DGNPLATFORM_EXPORT bool operator==(const_iterator const& rhs) const;
366 DGNPLATFORM_EXPORT bool operator!=(const_iterator const& rhs) const;
367  };
368 
370 
372 
373  const_iterator begin () const {return const_iterator (m_model, false);}
374  const_iterator end () const {return const_iterator (m_model, true);}
375 
376 }; // ApplicableSignaturesCollection
377 
379 
380 
382 
383 
384 
A readonly "handle" to an element.
Definition: ElementHandle.h:113
Signature annotation data.
Definition: Dsig.h:27
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
Base class for application defined cells that want to be treated as a single object.
Definition: CellHeaderHandler.h:82
Provides access to digital signatures in a DGN file.
Definition: DigitalSignatureCellHeaderHandler.h:86
#define ELEMENTHANDLER_DECLARE_MEMBERS(__classname__, __exporter__)
Definition: Handler.h:86
ModelSignatureCollection(DgnModelR c)
Definition: DigitalSignatureCellHeaderHandler.h:320
A writeable "handle" to an MSElement.
Definition: ElementHandle.h:470
unsigned long ULong32
Definition: Bentley.r.h:146
DigitalSignatureIterator const_iterator
Definition: DigitalSignatureCellHeaderHandler.h:317
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
A DgnFile is an in-memory representation of a physical file, regardless of its format.
Definition: DgnFile.h:308
The collection of all digital signatures in a file that have file-wide scope.
Definition: DigitalSignatureCellHeaderHandler.h:280
Definition: DigitalSignatureCellHeaderHandler.h:351
DigitalSignatureIterator end() const
Definition: DigitalSignatureCellHeaderHandler.h:292
PersistentElementRefList - a list of Dgn Elements.
Definition: DgnModel.h:102
The collection of all digital signatures in a model that are scoped to that model.
Definition: DigitalSignatureCellHeaderHandler.h:311
A DgnModel represents a DgnModel in memory.
Definition: DgnModel.h:236
Iterate over the elements in a PersistentElementRefList.
Definition: DgnModel.h:57
Information about a digital signature.
Definition: DigitalSignatureCellHeaderHandler.h:103
Definition: ITextEdit.h:144
A bvector of EditElementHandle entries to be used for operating on groups of elements.
Definition: ElementAgenda.h:257
const_iterator begin() const
Definition: DigitalSignatureCellHeaderHandler.h:373
const_iterator end() const
Definition: DigitalSignatureCellHeaderHandler.h:374
DigitalSignatureIterator begin() const
Definition: DigitalSignatureCellHeaderHandler.h:291
Interface that provides direct and efficient access to element data.
Definition: ElementRefBase.h:120
unsigned char byte
Definition: Bentley.r.h:144
#define DEFINE_T_SUPER(B)
Definition: Bentley.h:167
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
DVec3d operator*(Transform const &transform, DVec3d const &vector)
operator overload for multiplication of a transform and a vector li>The vector appears on the left as...
bool operator!=(const BentleyAllocator< _Ty > &, const BentleyAllocator< _Other > &)
Definition: BentleyAllocator.h:152
int StatusInt
Definition: Bentley.h:222
The collection of all signatures that apply to the content viewed through a specified model...
Definition: DigitalSignatureCellHeaderHandler.h:345
const_iterator iterator
only const iteration is possible
Definition: DigitalSignatureCellHeaderHandler.h:287
const_iterator iterator
only const iteration is possible
Definition: DigitalSignatureCellHeaderHandler.h:369
const_iterator iterator
only const iteration is possible
Definition: DigitalSignatureCellHeaderHandler.h:318
struct DgnPlatform::ElementHandle const & ElementHandleCR
Definition: DgnPlatform.h:260
DigitalSignatureIterator const_iterator
Definition: DigitalSignatureCellHeaderHandler.h:286
FileSignatureCollection(DgnFileR f)
Definition: DigitalSignatureCellHeaderHandler.h:289
DigitalSignatureIterator end() const
Definition: DigitalSignatureCellHeaderHandler.h:323
Information about a digital signature.
Definition: Dsig.h:50
DigitalSignatureIterator begin() const
Definition: DigitalSignatureCellHeaderHandler.h:322
Iterator over digital signature cell elements.
Definition: DigitalSignatureCellHeaderHandler.h:237
bool operator==(const BentleyAllocator< _Ty > &, const BentleyAllocator< _Other > &)
Definition: BentleyAllocator.h:146
ApplicableSignaturesCollection(DgnModelR c)
Definition: DigitalSignatureCellHeaderHandler.h:371

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