L_DicomGetSignature

#include "ltdic.h"

L_LTDIC_API pDICOMELEMENT L_DicomGetSignature(hDS, pItem, uIndex)

Returns a pointer to the Digital Signatures Sequence Item that corresponds to the Digital Signature at the specified index.

Parameters

HDICOMDS hDS

A DICOM handle.

pDICOMELEMENT pItem

Pointer to a DICOMELEMENT structure that specifies the Item in which the required Digital Signature is located. Set this parameter to NULL if the Digital Signature is located in the main Data Set.

L_UINT32 uIndex

The index of the required Digital Signature. This should be a number from 0 to L_DicomGetSignaturesCount(pItem) minus 1.

Returns

Value Meaning
!NULL Pointer to the DICOMELEMENT structure that specifies the Digital Signatures Sequence Item which corresponds to the required Digital Signature.
NULL The specified index is invalid.

Comments

For each Digital Signature in the main Data Set or in an Item of a Sequence of Items, there should be a corresponding Item under the Digital Signatures Sequence (FFFA,FFFA) located in the main Data Set or in the Item. This function can be used to obtain a pointer to that Digital Signatures Sequence Item.

Along with this function, the function L_DicomGetSignaturesCount can be used to enumerate the Digital Signatures in the main Data Set or in an Item of a Sequence of Items. Once a pointer to the Digital Signatures Sequence Item is obtained, the following functions can be used to verify, delete, or get information about the Digital Signature:

You can also use the function L_DicomFindSignature to search the whole Data Set for a specific Digital Signature.

Required DLLs and Libraries

Platforms

Win32, x64

See Also

Functions

Topics

Example

L_INT DicomGetSignatureExample(HDICOMDS hDS) 
{ 
   // We will enumerate the Digital Signatures in the main Data Set 
   L_TCHAR szMsg[128]; 
   L_UINT32 i; 
   L_INT nRet; 
 
   L_UINT32 uSignaturesCount = L_DicomGetSignaturesCount(hDS,NULL); 
   if (uSignaturesCount == 0) 
   { 
      MessageBox(NULL, 
                   TEXT("There are no Digital Signatures in the main Data Set."), 
                   TEXT("Sample"), 
                   MB_OK); 
      return FAILURE - 1; 
   } 
    
   if (uSignaturesCount == 1) 
   { 
      lstrcpy(szMsg, 
              TEXT("There is 1 Digital Signature in the main Data Set. ") 
              TEXT("Do you want to examine it?")); 
   } 
   else 
   { 
      wsprintf(szMsg, 
               TEXT("There are %lu Digital Signatures in the main Data Set. ") 
               TEXT("Do you want to examine them?"), uSignaturesCount); 
   } 
 
   if (MessageBox(NULL, szMsg, TEXT("Sample"), MB_YESNO) != IDYES) 
      return FAILURE - 1; 
 
   for (i = 0; i < uSignaturesCount; i++) 
   { 
      // Refer to the example of L_DicomVerifySignature for the 
      // function DicomVerifySignatureExample 
      nRet = DicomVerifySignatureExample(hDS, L_DicomGetSignature(hDS,NULL, i)); 
      if (nRet != SUCCESS) 
         return nRet; 
   } 
 
   return DICOM_SUCCESS; 
} 
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.