CFx SDK Documentation  2022 SP0
OdCryptoServices.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 //OdCryptoServices - interface that provides services to enable developers to secure applications using cryptography
25 
26 #ifndef _ODCRYPTOSERVICES_H__458F3BE0_8868_489B_B1D1_B1102D86667D__INCLUDED_
27 #define _ODCRYPTOSERVICES_H__458F3BE0_8868_489B_B1D1_B1102D86667D__INCLUDED_
28 
29 #include "TD_PackPush.h"
30 
31 #include "RootExport.h"
32 #include "SharedPtr.h"
33 #include "OdArray.h"
34 #include "OdString.h"
35 #include "OdBinaryData.h"
36 #include "OdLinkedArray.h"
37 
39 {
40 public:
44  //FELIX_CHANGE_BEGIN
46  //FELIX_CHANGE_END
47 };
48 
50 {
51 public:
54 };
55 
56 
58 {
59 public:
60  virtual ~OdCertificateObject() {}
61 
63  virtual bool isTrusted() const = 0;
64 };
65 
67 
68 
70 {
71 public:
72  virtual ~OdCryptAttrib() {}
73 
74  virtual OdString getObjId() const = 0;
75  virtual void getValues(OdArray<OdBinaryData>& values) const = 0;
76 };
77 
79 
80 
82 {
83 protected:
85 public:
87 };
88 
90 
91 
93 {
94 public:
96 
98 };
99 
100 
102 {
103 public:
105 
107  virtual OdCertificateObjectPtr getCertObjByShortDesc(const OdCertificateShortDesc& certShortDesc) const = 0;
108 
110  {
111  kSuccess = 0,
119  kUnknownError
120  };
121 
122  virtual OdCryptAttribPtr newCryptAttrib(const OdString& objId, const OdArray<OdBinaryData>& values) = 0;
124  const OdArray<OdCryptAttribPtr>& unauthAttribs) = 0;
125 
126  virtual bool generateDetachedSignature(const OdCryptSignMessageParaPtr& pSignPara,
127  const OdLinkedArray<OdBinaryData>& message, OdBinaryData& signature) = 0;
128 
129  virtual void verifyDetachedSignature(const OdLinkedArray<OdBinaryData>& message, const OdBinaryData& signature,
130  OdSignatureVerificationResult& verificationResult) = 0;
131 
134  OdArray<OdCryptAttribPtr>& unauthAttribs) = 0;
135 
136 
137  virtual bool initSessionKeyToEncryptData(const OdString& password,
138  OdUInt32 nProvType, const OdString& provName, OdUInt32 nAlgId, OdUInt32 nKeyLength) = 0;
139  virtual void resetSessionKeyToEncryptData() = 0;
140 
141  virtual bool encryptData(OdUInt8* buffer, OdUInt32 bufferSize) = 0;
142  virtual bool decryptData(OdUInt8* buffer, OdUInt32 bufferSize) = 0;
143 };
144 
146 
147 
148 #include "TD_PackPop.h"
149 
150 #endif
OdSmartPtr< OdCryptoServices > OdCryptoServicesPtr
OdSharedPtr< OdCertificateObject > OdCertificateObjectPtr
OdSharedPtr< OdCryptAttrib > OdCryptAttribPtr
OdSharedPtr< OdCryptSignMessagePara > OdCryptSignMessageParaPtr
unsigned int OdUInt32
unsigned char OdUInt8
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
virtual bool isTrusted() const =0
virtual ~OdCertificateObject()
virtual OdCertificateDescription getCertDescription() const =0
virtual void getValues(OdArray< OdBinaryData > &values) const =0
virtual ~OdCryptAttrib()
virtual OdString getObjId() const =0
virtual void resetSessionKeyToEncryptData()=0
virtual OdCertificateObjectPtr getCertObjByShortDesc(const OdCertificateShortDesc &certShortDesc) const =0
virtual void verifyDetachedSignature(const OdLinkedArray< OdBinaryData > &message, const OdBinaryData &signature, OdSignatureVerificationResult &verificationResult)=0
virtual OdUInt32 getPersonalCertsWithTrustedStatus(OdArray< OdCertificateDescription > &certificates) const =0
virtual OdCryptSignMessageParaPtr newCryptSignMessagePara(const OdCertificateObjectPtr &pCertObj, const OdArray< OdCryptAttribPtr > &unauthAttribs)=0
ODRX_DECLARE_MEMBERS(OdCryptoServices)
virtual bool initSessionKeyToEncryptData(const OdString &password, OdUInt32 nProvType, const OdString &provName, OdUInt32 nAlgId, OdUInt32 nKeyLength)=0
virtual bool generateDetachedSignature(const OdCryptSignMessageParaPtr &pSignPara, const OdLinkedArray< OdBinaryData > &message, OdBinaryData &signature)=0
virtual bool decryptData(OdUInt8 *buffer, OdUInt32 bufferSize)=0
virtual void getUnauthAttribsFromDetachedSignature(const OdBinaryData &signature, OdArray< OdCryptAttribPtr > &unauthAttribs)=0
virtual OdCertificateObjectPtr getCertFromDetachedSignature(const OdBinaryData &signature)=0
virtual OdCryptAttribPtr newCryptAttrib(const OdString &objId, const OdArray< OdBinaryData > &values)=0
virtual bool encryptData(OdUInt8 *buffer, OdUInt32 bufferSize)=0
OdCertificateDescription m_certDesc
GLuint buffer
Definition: gles2_ext.h:178