←Select platform

FindSignature Method

Summary
Returns the Digital Signatures Sequence Item that corresponds to the Digital Signature that has the specified Digital Signature UID, if found in the Data Set.
Syntax
C#
C++/CLI
public DicomElement FindSignature( 
   string signatureUID 
) 
public: 
DicomElement^ FindSignature(  
   String^ signatureUID 
)  

Parameters

signatureUID
Character string that contains the Digital Signature UID of the Digital Signature for which to search.

Return Value

The Digital Signatures Sequence Item that corresponds to the Digital Signature with the specified Digital Signature UID, or a null reference (Nothing in VB) if no such Digital Signature was found in the Data Set.

Remarks

Each Digital Signature should be uniquely identified by a UID specified by the Digital Signature UID (0400,0100) under the corresponding Digital Signatures Sequence Item. Call this method to search the whole Data Set for a Digital Signature by its Digital Signature UID. Once the Digital Signatures Sequence Item is obtained, the following methods can be used to verify, delete, or get information about the Digital Signature:

VerifySignature

DeleteSignature

GetSignatureUID

GetSignatureDateTime

GetSignedElementsCount

GetSignedElement

GetMacTransferSyntax

GetMacAlgorithm

SaveCertificate

Call the GetSignaturesCount and GetSignature methods to enumerate the Digital Signatures in the main Data Set or in an item of a Sequence of Items.

Example

This example will locate (find) a digital signature inside a DICOM dataset by searching for its UID.

C#
using Leadtools; 
using Leadtools.Dicom; 
 
 
public void FindSignature() 
{ 
   string dicomFileName = Path.Combine(LEAD_VARS.ImagesDir, "DICOM", "image3.dcm"); 
   //Make sure to initialize the DICOM engine, this needs to be done only once  
   //In the whole application 
   DicomEngine.Startup(); 
   using (DicomDataSet ds = new DicomDataSet()) 
   { 
      //Load DICOM File 
      ds.Load(dicomFileName, DicomDataSetLoadFlags.None); 
      string signatureUID = "1.2.840.114257.0.130573664"; 
      // Search the whole Data Set for the Digital Signature with the 
      // specified Digital Signature UID 
      DicomElement signatureItem = ds.FindSignature(signatureUID); 
      if (signatureItem != null) 
      { 
         ds.DeleteSignature(signatureItem); 
         Console.WriteLine("Sample: The Digital Signature was found and got deleted."); 
      } 
      else 
      { 
         Assert.Fail("signatureItem is null"); 
         Console.WriteLine("Sample: The Digital Signature could not be found."); 
      } 
   } 
   DicomEngine.Shutdown(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Dicom Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.