CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
OdCryptoServices Class Referenceabstract

#include <OdCryptoServices.h>

Inheritance diagram for OdCryptoServices:
OdRxObject

Public Types

enum  OdSignatureVerificationResult {
  kSuccess = 0 , kHasNoSignature , kBadSignature , kCertificateChainProblem ,
  kBadAlgId , kNoSigner , kUnexpectedMsgType , kInvalidArg ,
  kUnknownError
}
 

Public Member Functions

 ODRX_DECLARE_MEMBERS (OdCryptoServices)
 
virtual OdUInt32 getPersonalCertsWithTrustedStatus (OdArray< OdCertificateDescription > &certificates) const =0
 
virtual OdCertificateObjectPtr getCertObjByShortDesc (const OdCertificateShortDesc &certShortDesc) const =0
 
virtual OdSubjectKeyIdAttribPtr newSubjectKeyIdentifierAttr (const OdBinaryData &dataOfAttrValue)=0
 
virtual OdCryptSignMessageParaPtr newCryptSignMessagePara (const OdCertificateObjectPtr &pCertObj, const OdSubjectKeyIdAttribPtr &pSubjectKeyIdAttr)=0
 
virtual bool generateDetachedSignature (const OdCryptSignMessageParaPtr &pSignPara, const OdLinkedArray< OdBinaryData > &message, OdBinaryData &signature)=0
 
virtual void verifyDetachedSignature (const OdLinkedArray< OdBinaryData > &message, const OdBinaryData &signature, OdSignatureVerificationResult &verificationResult)=0
 
virtual OdCertificateObjectPtr getCertFromDetachedSignature (const OdBinaryData &signature)=0
 
virtual OdSubjectKeyIdAttribPtr getSubjectKeyIdFromDetachedSignature (const OdBinaryData &signature)=0
 
virtual bool initSessionKeyToEncryptData (const OdBinaryData &passwordAsBinaryData, OdUInt32 nProvType, const OdString &provName, OdUInt32 nAlgId, OdUInt32 nKeyLength)=0
 
virtual void resetSessionKeyToEncryptData ()=0
 
virtual bool encryptData (OdUInt8 *buffer, OdUInt32 bufferSize)=0
 
virtual bool decryptData (OdUInt8 *buffer, OdUInt32 bufferSize)=0
 
- Public Member Functions inherited from OdRxObject
 ODRX_HEAP_OPERATORS ()
 
 OdRxObject ()
 
virtual ~OdRxObject ()
 
virtual OdRxObjectqueryX (const OdRxClass *pClass) const
 
virtual OdRxObjectx (const OdRxClass *pClass) const
 
virtual OdRxClassisA () const
 
virtual void addRef ()=0
 
virtual void release ()=0
 
virtual long numRefs () const
 
bool isKindOf (const OdRxClass *pClass) const
 
virtual OdRxObjectPtr clone () const
 
virtual void copyFrom (const OdRxObject *pSource)
 
virtual OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Additional Inherited Members

- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Detailed Description

This class defines the interface of crypto services. <group Other_Classes>

Definition at line 139 of file OdCryptoServices.h.

Member Enumeration Documentation

◆ OdSignatureVerificationResult

Enumerator
kSuccess 
kHasNoSignature 
kBadSignature 
kCertificateChainProblem 
kBadAlgId 
kNoSigner 
kUnexpectedMsgType 
kInvalidArg 
kUnknownError 

Definition at line 163 of file OdCryptoServices.h.

Member Function Documentation

◆ decryptData()

virtual bool OdCryptoServices::decryptData ( OdUInt8 buffer,
OdUInt32  bufferSize 
)
pure virtual

Decrypts the specified buffer.

Parameters
bufferSize[in] Number of bytes.
buffer[in/out] Data to be decrypted.
Returns
Returns true if and only if successful.

◆ encryptData()

virtual bool OdCryptoServices::encryptData ( OdUInt8 buffer,
OdUInt32  bufferSize 
)
pure virtual

Encrypts the specified buffer.

Parameters
bufferSize[in] Number of bytes.
buffer[in/out] Data to be encrypted.
Returns
Returns true if and only if successful.

◆ generateDetachedSignature()

virtual bool OdCryptoServices::generateDetachedSignature ( const OdCryptSignMessageParaPtr pSignPara,
const OdLinkedArray< OdBinaryData > &  message,
OdBinaryData signature 
)
pure virtual

Generates detached signature for the message using signature parameters passed.

Parameters
pSignPara[in] signature parameters.
message[in] data to be signed.
signature[out] generated signature.
Returns
Returns true if success, otherwise returns false.

◆ getCertFromDetachedSignature()

virtual OdCertificateObjectPtr OdCryptoServices::getCertFromDetachedSignature ( const OdBinaryData signature)
pure virtual

Obtains signing certificate from the signature data block.

Parameters
signature[in] signature data block.
Returns
Returns certificate object.

◆ getCertObjByShortDesc()

virtual OdCertificateObjectPtr OdCryptoServices::getCertObjByShortDesc ( const OdCertificateShortDesc certShortDesc) const
pure virtual


Parameters
certShortDesc[in] certificate short description.
Returns
Returns certificate object corresponding to short description.

◆ getPersonalCertsWithTrustedStatus()

virtual OdUInt32 OdCryptoServices::getPersonalCertsWithTrustedStatus ( OdArray< OdCertificateDescription > &  certificates) const
pure virtual

Fills an array of descriptions with data of all trusted certificates
presented in certificate store for which the private key is available.

Parameters
certificates[out] descriptions array.
Returns
Returns number of certificates obtained.

◆ getSubjectKeyIdFromDetachedSignature()

virtual OdSubjectKeyIdAttribPtr OdCryptoServices::getSubjectKeyIdFromDetachedSignature ( const OdBinaryData signature)
pure virtual

Obtains an existing attribute Subject Key Identifier from the signature data block.

Parameters
signature[in] signature data block.
Returns
Returns attribute object.

◆ initSessionKeyToEncryptData()

virtual bool OdCryptoServices::initSessionKeyToEncryptData ( const OdBinaryData passwordAsBinaryData,
OdUInt32  nProvType,
const OdString provName,
OdUInt32  nAlgId,
OdUInt32  nKeyLength 
)
pure virtual

Initializes a session key structures to encrypt/decrypt data using key derived from password.

Parameters
passwordAsBinaryData[in] password as binary data.
nProvType[in] crypto provider type.
provName[in] crypto provider name.
nAlgId[in] algorithm identifier.
nKeyLength[in] key length.
Returns
Returns true if success, otherwise returns false.

◆ newCryptSignMessagePara()

virtual OdCryptSignMessageParaPtr OdCryptoServices::newCryptSignMessagePara ( const OdCertificateObjectPtr pCertObj,
const OdSubjectKeyIdAttribPtr pSubjectKeyIdAttr 
)
pure virtual

Creates signature parameters object using certificate and attribute Subject Key Identifier.

Parameters
pCertObj[in] reference to certificate object pointer.
pSubjectKeyIdAttr[in] reference to attribute object pointer (pointer itself may be NULL due to attribute is optional).
Returns
Returns created signature parameters.

◆ newSubjectKeyIdentifierAttr()

virtual OdSubjectKeyIdAttribPtr OdCryptoServices::newSubjectKeyIdentifierAttr ( const OdBinaryData dataOfAttrValue)
pure virtual

Creates an attribute Subject Key Identifier using binary data as a value.

Parameters
dataOfAttrValue[in] binary data for attribute value.
Returns
Returns created attribute.

◆ ODRX_DECLARE_MEMBERS()

OdCryptoServices::ODRX_DECLARE_MEMBERS ( OdCryptoServices  )

◆ resetSessionKeyToEncryptData()

virtual void OdCryptoServices::resetSessionKeyToEncryptData ( )
pure virtual

Reset session key structures.

◆ verifyDetachedSignature()

virtual void OdCryptoServices::verifyDetachedSignature ( const OdLinkedArray< OdBinaryData > &  message,
const OdBinaryData signature,
OdSignatureVerificationResult verificationResult 
)
pure virtual

Verifies detached signature for the message.

Parameters
message[in] message data.
signature[in] message signature.
verificationResult[out] result of verification.

The documentation for this class was generated from the following file: