Aspose::Pdf::Facades::PdfFileSignature Class Referencefinal

Represents a class to sign a pdf file with a certificate. More...

Inherits Aspose::Pdf::Facades::SaveableFacade.

Public Member Functions

ASPOSE_PDF_SHARED_API System::String get_SignatureAppearance () const
 Sets or gets a graphic appearance for the signature. Property value represents image file name. More...
 
ASPOSE_PDF_SHARED_API void set_SignatureAppearance (System::String value)
 Sets or gets a graphic appearance for the signature. Property value represents image file name. More...
 
ASPOSE_PDF_SHARED_API bool get_IsLtvEnabled ()
 Gets the LTV enabled flag. More...
 
ASPOSE_PDF_SHARED_API bool get_IsCertified ()
 Gets the flag determining whether a document is certified or not. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< System::IO::Streamget_SignatureAppearanceStream () const
 Sets or gets a graphic appearance for the signature. Property value represents image stream. More...
 
ASPOSE_PDF_SHARED_API void set_SignatureAppearanceStream (System::SharedPtr< System::IO::Stream > value)
 Sets or gets a graphic appearance for the signature. Property value represents image stream. More...
 
ASPOSE_PDF_SHARED_API PdfFileSignature ()
 The constructor of PdfFileSignature class. More...
 
ASPOSE_PDF_SHARED_API PdfFileSignature (System::String inputFile)
 The constructor of PdfFileSignature class. More...
 
ASPOSE_PDF_SHARED_API PdfFileSignature (System::String inputFile, System::String outputFile)
 The constructor of PdfFileSignature class. More...
 
ASPOSE_PDF_SHARED_API void BindPdf (System::String inputFile) override
 Binds a Pdf file for editing. More...
 
ASPOSE_PDF_SHARED_API void BindPdf (System::SharedPtr< System::IO::Stream > inputStream) override
 Binds a Pdf stream for editing. More...
 
ASPOSE_PDF_SHARED_API void Save (System::String outputFile) override
 Saves the result PDF to file. More...
 
ASPOSE_PDF_SHARED_API void Save (System::SharedPtr< System::IO::Stream > outputStream) override
 Saves the result PDF to stream. More...
 
ASPOSE_PDF_SHARED_API void Sign (int32_t page, System::String SigReason, System::String SigContact, System::String SigLocation, bool visible, System::Drawing::Rectangle annotRect)
 Make a signature on the pdf document. More...
 
ASPOSE_PDF_SHARED_API void Sign (int32_t page, System::String SigReason, System::String SigContact, System::String SigLocation, bool visible, System::Drawing::Rectangle annotRect, System::SharedPtr< Aspose::Pdf::Forms::Signature > sig)
 Sign the document with the given type signature. More...
 
ASPOSE_PDF_SHARED_API void Sign (int32_t page, bool visible, System::Drawing::Rectangle annotRect, System::SharedPtr< Aspose::Pdf::Forms::Signature > sig)
 Sign the document with the given type signature. More...
 
ASPOSE_PDF_SHARED_API void Sign (System::String SigName, System::String SigReason, System::String SigContact, System::String SigLocation, System::SharedPtr< Aspose::Pdf::Forms::Signature > sig)
 Sign the document with the given type signature which is placed in already presented signature field. Before signing signature field must be empty, i.e. field must not contain signature dictionary. Thus pdf document already has signature field, you should not supply the place to stamp the signature, corresponding page and rectangle are taken from signature field which is found by signature name (see SigName parameter). More...
 
ASPOSE_PDF_SHARED_API void Sign (int32_t page, System::String SigName, System::String SigReason, System::String SigContact, System::String SigLocation, bool visible, System::Drawing::Rectangle annotRect, System::SharedPtr< Aspose::Pdf::Forms::Signature > sig)
 Sign the document with the given type signature which is placed in already presented signature field. Before signing pdf document should already has signature field, corresponding page and rectangle are taken from signature field which is found by signature name (see SigName parameter). More...
 
ASPOSE_PDF_SHARED_API void Sign (System::String SigName, System::SharedPtr< Aspose::Pdf::Forms::Signature > sig)
 Sign the document with the given type signature which is placed in already presented signature field. Before signing signature field must be empty, i.e. field must not contain signature dictionary. Thus pdf document already has signature field, you should not supply the place to stamp the signature, corresponding page and rectangle are taken from signature field which is found by signature name (see SigName parameter). Such data as signature reason, contact and location must be provided by corresponding properties of the Signature object sig. More...
 
ASPOSE_PDF_SHARED_API Aspose::Pdf::Forms::DocMDPAccessPermissions GetAccessPermissions ()
 Returns the access permissions value of certified document by the MDP signature type. More...
 
ASPOSE_PDF_SHARED_API void Certify (int32_t page, System::String SigReason, System::String SigContact, System::String SigLocation, bool visible, System::Drawing::Rectangle annotRect, System::SharedPtr< Aspose::Pdf::Forms::DocMDPSignature > docMdpSignature)
 Certify the document with the MDP signature. Such data as signature reason, contact and location must be provided by corresponding properties of the Signature object sig. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< System::Collections::Generic::IList< System::String > > GetSignNames ()
 Gets the names of all not empty signatures. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< System::Collections::Generic::IList< System::String > > GetBlankSignNames ()
 Gets the names of all empty signature fields. More...
 
ASPOSE_PDF_SHARED_API bool IsContainSignature ()
 Checks if the pdf has a digital signature or not. More...
 
ASPOSE_PDF_SHARED_API bool ContainsSignature ()
 Checks if the pdf has a digital signature or not. More...
 
ASPOSE_PDF_SHARED_API bool ContainsUsageRights ()
 Checks if the pdf has a usage rights or not. More...
 
ASPOSE_PDF_SHARED_API bool IsCoversWholeDocument (System::String signName)
 Checks if the signature covers the whole document. More...
 
ASPOSE_PDF_SHARED_API bool CoversWholeDocument (System::String signName)
 Checks if the signature covers the whole document. More...
 
ASPOSE_PDF_SHARED_API int32_t GetRevision (System::String signName)
 Gets the revision of a signature. More...
 
ASPOSE_PDF_SHARED_API int32_t GetTotalRevision ()
 Gets the toltal revision. More...
 
ASPOSE_PDF_SHARED_API void RemoveUsageRights ()
 Removes the usage rights entry. More...
 
ASPOSE_PDF_SHARED_API void RemoveSignature (System::String signName)
 Remove the signature according to the name of the signature. More...
 
ASPOSE_PDF_SHARED_API void RemoveSignature (System::String signName, bool removeField)
 Removes the signature according to the name of the signature. More...
 
ASPOSE_PDF_SHARED_API bool VerifySigned (System::String signName)
 Checks the validity of a signature. More...
 
ASPOSE_PDF_SHARED_API System::String GetSignerName (System::String signName)
 Gets the name of person or organization who signing the pdf document. More...
 
ASPOSE_PDF_SHARED_API System::DateTime GetDateTime (System::String signName)
 Gets the signature's datetime. More...
 
ASPOSE_PDF_SHARED_API System::String GetReason (System::String signName)
 Gets the reason of a signature. More...
 
ASPOSE_PDF_SHARED_API System::String GetLocation (System::String signName)
 Gets the location of a signature. More...
 
ASPOSE_PDF_SHARED_API System::String GetContactInfo (System::String signName)
 Gets the contact information of a signature. More...
 
ASPOSE_PDF_SHARED_API bool VerifySignature (System::String signName)
 Checks the validity of a signature. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< System::IO::StreamExtractImage (System::String signName)
 Extracts signature's image. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< System::IO::StreamExtractCertificate (System::String signName)
 Extracts signature's single X.509 certificate as a stream. More...
 
ASPOSE_PDF_SHARED_API void Save ()
 Save signed pdf file. Output filename must be provided before with the help of coresponding PdfFileSignature constructor. More...
 
ASPOSE_PDF_SHARED_API PdfFileSignature (System::SharedPtr< Aspose::Pdf::Document > document)
 Initializes new PdfFileSignature object on base of the document . More...
 
ASPOSE_PDF_SHARED_API PdfFileSignature (System::SharedPtr< Aspose::Pdf::Document > document, System::String outputFile)
 Initializes new PdfFileSignature object on base of the document . More...
 
ASPOSE_PDF_SHARED_API void SetCertificate (System::String pfx, System::String pass)
 Set certificate file and password for signing routine. More...
 
ASPOSE_PDF_SHARED_API void Close () override
 Closes the facade. More...
 
- Public Member Functions inherited from Aspose::Pdf::Facades::Facade
ASPOSE_PDF_SHARED_API System::SharedPtr< Aspose::Pdf::Documentget_Document () const
 Gets the document facade is working on. More...
 
ASPOSE_PDF_SHARED_API void SetVentureLicense (System::SharedPtr< Aspose::Pdf::LicenseManagement::VentureLicense > license) override
 
ASPOSE_PDF_SHARED_API System::SharedPtr< Aspose::Pdf::LicenseManagement::VentureLicense > GetVentureLicense () override
 
ASPOSE_PDF_SHARED_API void BindPdf (System::SharedPtr< Aspose::Pdf::Document > srcDoc) override
 Initializes the facade. More...
 
ASPOSE_PDF_SHARED_API void Dispose () override
 Disposes the facade. More...
 
- Public Member Functions inherited from Aspose::Pdf::Facades::IFacade
virtual void BindPdf (System::SharedPtr< Document > srcDoc)=0
 Binds PDF document for editing. More...
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared reference counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API String ToString () const
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual ASPOSECPP_SHARED_API bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool Equals (double const &objA, double const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 Specialization of Object::ReferenceEquals for case of string and nullptr. More...
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 Specialization of Object::ReferenceEquals for case of strings. More...
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Implements C# typeof(System.Object) construct. More...
 
- Protected Member Functions inherited from Aspose::Pdf::Facades::SaveableFacade
ASPOSE_PDF_SHARED_API SaveableFacade ()
 The constructor. More...
 
ASPOSE_PDF_SHARED_API SaveableFacade (System::SharedPtr< Aspose::Pdf::Document > srcDoc)
 The constructor. More...
 
- Protected Member Functions inherited from Aspose::Pdf::Facades::Facade
bool get__IsObjectLicensed ()
 Gets licensed state of the system. Returns true is system works in licensed mode and false otherwise. More...
 
ASPOSE_PDF_SHARED_API Facade ()
 The constructor. More...
 
ASPOSE_PDF_SHARED_API Facade (System::SharedPtr< Aspose::Pdf::Document > srcDoc)
 The constructor. More...
 
virtual ASPOSE_PDF_SHARED_API void BindPdf (System::String srcFile, System::String password)
 Initializes the facade. More...
 
virtual ASPOSE_PDF_SHARED_API void BindPdf (System::SharedPtr< System::IO::Stream > srcStream, System::String password)
 Initializes the facade. More...
 
virtual ASPOSE_PDF_SHARED_API void AssertDocument () const
 Asserts if the facade is initialized. More...
 
virtual ASPOSE_PDF_SHARED_API ~Facade ()
 

Detailed Description

Represents a class to sign a pdf file with a certificate.

Constructor & Destructor Documentation

◆ PdfFileSignature() [1/5]

ASPOSE_PDF_SHARED_API Aspose::Pdf::Facades::PdfFileSignature::PdfFileSignature ( )

The constructor of PdfFileSignature class.

◆ PdfFileSignature() [2/5]

ASPOSE_PDF_SHARED_API Aspose::Pdf::Facades::PdfFileSignature::PdfFileSignature ( System::String  inputFile)

The constructor of PdfFileSignature class.

Deprecated:
Use another constructor for instance initialization.
Parameters
inputFileThe input file for signature.

◆ PdfFileSignature() [3/5]

ASPOSE_PDF_SHARED_API Aspose::Pdf::Facades::PdfFileSignature::PdfFileSignature ( System::String  inputFile,
System::String  outputFile 
)

The constructor of PdfFileSignature class.

Deprecated:
Use another constructor for instance initialization.
Parameters
inputFileThe input file for signature.
outputFileThe output file.

◆ PdfFileSignature() [4/5]

ASPOSE_PDF_SHARED_API Aspose::Pdf::Facades::PdfFileSignature::PdfFileSignature ( System::SharedPtr< Aspose::Pdf::Document document)

Initializes new PdfFileSignature object on base of the document .

Parameters
documentPdf document.

◆ PdfFileSignature() [5/5]

ASPOSE_PDF_SHARED_API Aspose::Pdf::Facades::PdfFileSignature::PdfFileSignature ( System::SharedPtr< Aspose::Pdf::Document document,
System::String  outputFile 
)

Initializes new PdfFileSignature object on base of the document .

Deprecated:
Use another constructor for instance initialization.
Parameters
documentPdf document.
outputFileThe output file.

Member Function Documentation

◆ BindPdf() [1/2]

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::BindPdf ( System::String  inputFile)
overridevirtual

Binds a Pdf file for editing.

Parameters
inputFileThe pdf file to be edited.

Reimplemented from Aspose::Pdf::Facades::Facade.

◆ BindPdf() [2/2]

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::BindPdf ( System::SharedPtr< System::IO::Stream inputStream)
overridevirtual

Binds a Pdf stream for editing.

Parameters
inputStreamThe pdf stream to be edited.

Reimplemented from Aspose::Pdf::Facades::Facade.

◆ Certify()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::Certify ( int32_t  page,
System::String  SigReason,
System::String  SigContact,
System::String  SigLocation,
bool  visible,
System::Drawing::Rectangle  annotRect,
System::SharedPtr< Aspose::Pdf::Forms::DocMDPSignature docMdpSignature 
)

Certify the document with the MDP signature. Such data as signature reason, contact and location must be provided by corresponding properties of the Signature object sig.

Parameters
pageThe page on which signature is made.
SigReasonThe reason of signature.
SigContactThe contact of signature.
SigLocationThe location of signature.
visibleThe visiblity of signature.
annotRectThe rect of signature.
docMdpSignatureThe document MDP type of the signature.

◆ Close()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::Close ( )
overridevirtual

Closes the facade.

Reimplemented from Aspose::Pdf::Facades::Facade.

◆ ContainsSignature()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Facades::PdfFileSignature::ContainsSignature ( )

Checks if the pdf has a digital signature or not.

Returns
Return a result of bool type.

◆ ContainsUsageRights()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Facades::PdfFileSignature::ContainsUsageRights ( )

Checks if the pdf has a usage rights or not.

Returns
Returns a result of bool type.

◆ CoversWholeDocument()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Facades::PdfFileSignature::CoversWholeDocument ( System::String  signName)

Checks if the signature covers the whole document.

Parameters
signNameThe name of signature.
Returns
Return a result of bool type.

◆ ExtractCertificate()

ASPOSE_PDF_SHARED_API System::SharedPtr<System::IO::Stream> Aspose::Pdf::Facades::PdfFileSignature::ExtractCertificate ( System::String  signName)

Extracts signature's single X.509 certificate as a stream.

Parameters
signNameThe name of signature.
Returns
If certificate was found returns X.509 single certificate; otherwise, null.

◆ ExtractImage()

ASPOSE_PDF_SHARED_API System::SharedPtr<System::IO::Stream> Aspose::Pdf::Facades::PdfFileSignature::ExtractImage ( System::String  signName)

Extracts signature's image.

Parameters
signNameThe name of signature.
Returns
If image was successfully found than returns stream object; otherwise, null.

◆ get_IsCertified()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Facades::PdfFileSignature::get_IsCertified ( )

Gets the flag determining whether a document is certified or not.

◆ get_IsLtvEnabled()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Facades::PdfFileSignature::get_IsLtvEnabled ( )

Gets the LTV enabled flag.

◆ get_SignatureAppearance()

ASPOSE_PDF_SHARED_API System::String Aspose::Pdf::Facades::PdfFileSignature::get_SignatureAppearance ( ) const

Sets or gets a graphic appearance for the signature. Property value represents image file name.

◆ get_SignatureAppearanceStream()

ASPOSE_PDF_SHARED_API System::SharedPtr<System::IO::Stream> Aspose::Pdf::Facades::PdfFileSignature::get_SignatureAppearanceStream ( ) const

Sets or gets a graphic appearance for the signature. Property value represents image stream.

◆ GetAccessPermissions()

ASPOSE_PDF_SHARED_API Aspose::Pdf::Forms::DocMDPAccessPermissions Aspose::Pdf::Facades::PdfFileSignature::GetAccessPermissions ( )

Returns the access permissions value of certified document by the MDP signature type.

Returns
If the document is being certified, than returns access permissions value; otherwise,
Exceptions
System::ApplicationException
is thrown.

◆ GetBlankSignNames()

ASPOSE_PDF_SHARED_API System::SharedPtr<System::Collections::Generic::IList<System::String> > Aspose::Pdf::Facades::PdfFileSignature::GetBlankSignNames ( )

Gets the names of all empty signature fields.

Returns
Return an IList.

◆ GetContactInfo()

ASPOSE_PDF_SHARED_API System::String Aspose::Pdf::Facades::PdfFileSignature::GetContactInfo ( System::String  signName)

Gets the contact information of a signature.

Parameters
signNameThe name of signature.
Returns
Returns a result of string type.

◆ GetDateTime()

ASPOSE_PDF_SHARED_API System::DateTime Aspose::Pdf::Facades::PdfFileSignature::GetDateTime ( System::String  signName)

Gets the signature's datetime.

Parameters
signNameThe name of signature.
Returns
Return the result of DateTime type.

◆ GetLocation()

ASPOSE_PDF_SHARED_API System::String Aspose::Pdf::Facades::PdfFileSignature::GetLocation ( System::String  signName)

Gets the location of a signature.

Parameters
signNameThe name of signature.
Returns
Returns a result of string type.

◆ GetReason()

ASPOSE_PDF_SHARED_API System::String Aspose::Pdf::Facades::PdfFileSignature::GetReason ( System::String  signName)

Gets the reason of a signature.

Parameters
signNameThe name of signature.
Returns
Returns a result of string type.

◆ GetRevision()

ASPOSE_PDF_SHARED_API int32_t Aspose::Pdf::Facades::PdfFileSignature::GetRevision ( System::String  signName)

Gets the revision of a signature.

Parameters
signNameThe name of signature.
Returns
Return the number of signature revision.

◆ GetSignerName()

ASPOSE_PDF_SHARED_API System::String Aspose::Pdf::Facades::PdfFileSignature::GetSignerName ( System::String  signName)

Gets the name of person or organization who signing the pdf document.

Parameters
signNameThe name of signature.
Returns
Returns the result of the signer's name.

◆ GetSignNames()

ASPOSE_PDF_SHARED_API System::SharedPtr<System::Collections::Generic::IList<System::String> > Aspose::Pdf::Facades::PdfFileSignature::GetSignNames ( )

Gets the names of all not empty signatures.

Returns
Return an IList.
[C#]
string inFile=TestPath + "example1.pdf";
pdfSign.BindPdf(inFile);
IList names=pdfSign.GetSignNames();
for(int i=0;i<names.Count;i++)
{
Console.WriteLine("signature name:"+(string)names[i]);
Console.WriteLine("coverswholedocument:"+pdfSign.IsCoversWholeDocument((string)names[i]));
Console.WriteLine("revision:"+pdfSign.GetRevision((string)names[i]));
Console.WriteLine("verifysigned:"+pdfSign.VerifySigned((string)names[i]));
Console.WriteLine("reason:"+pdfSign.GetReason((string)names[i]));
Console.WriteLine("location:"+pdfSign.GetLocation((string)names[i]));
Console.WriteLine("datatime:"+pdfSign.GetDateTime((string)names[i]));
}
Console.WriteLine("totalvision:"+pdfSign.GetTotalRevision());
[Visual Basic]
Dim pdfSign as PdfFileSignature =new PdfFileSignature
pdfSign.BindPdf(inFile)
Dim names as IList
names=pdfSign.GetSignNames()
For i=0 To names.Count
@verbatim
Console.WriteLine("signature name:" + (string)names[i])
Console.WriteLine("coverswholedocument:" + pdfSign.IsCoversWholeDocument((string)names[i]))
Console.WriteLine("revision:" + pdfSign.GetRevision((string)names[i]))
Console.WriteLine("verifysigned:" + pdfSign.VerifySigned((string)names[i]))
Console.WriteLine("reason:" + pdfSign.GetReason((string)names[i]))
Console.WriteLine("location:" + pdfSign.GetLocation((string)names[i]))
Console.WriteLine("datatime:" + pdfSign.GetDateTime((string)names[i]))
@endverbatim
Next i
Console.WriteLine("totalvision:"+pdfSign.GetTotalRevision())

◆ GetTotalRevision()

ASPOSE_PDF_SHARED_API int32_t Aspose::Pdf::Facades::PdfFileSignature::GetTotalRevision ( )

Gets the toltal revision.

Returns
Return the total number of signature revision.

◆ IsContainSignature()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Facades::PdfFileSignature::IsContainSignature ( )

Checks if the pdf has a digital signature or not.

Deprecated:
ContainsSignature should be used instead of IsContainSignature.
Returns
Return a result of bool type.

◆ IsCoversWholeDocument()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Facades::PdfFileSignature::IsCoversWholeDocument ( System::String  signName)

Checks if the signature covers the whole document.

Deprecated:
CoversWholeDocument should be used instead of IsCoversWholeDocument.
Parameters
signNameThe name of signature.
Returns
Return a result of bool type.

◆ RemoveSignature() [1/2]

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::RemoveSignature ( System::String  signName)

Remove the signature according to the name of the signature.

Parameters
signNameThe name of signature.
[C#]
string inFile = TestPath + "example1.pdf";
PdfFileSignature pdfSign = new PdfFileSignature();
pdfSign.BindPdf(inFile);
IList names = pdfSign.GetSignNames();
for(int i = 0; i < names.Count; i++)
{
pdfSign.RemoveSignature((string)names[i]);
}
pdfSign.Save(TestPath + "signed_removed.pdf");
[Visual Basic]
Dim pdfSign as PdfFileSignature = new PdfFileSignature
pdfSign.BindPdf(inFile)
Dim names as IList
names = pdfSign.GetSignNames()
For i = 0 To names.Count
pdfSign.RemoveSignature((string)names[i])
pdfSign.Save(TestPath + "signed_removed.pdf")

◆ RemoveSignature() [2/2]

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::RemoveSignature ( System::String  signName,
bool  removeField 
)

Removes the signature according to the name of the signature.

Parameters
signNameThe name of signature.
removeFieldIf set to true, than removes both of signature and field from document; otherwise, signature only.
[C#]
string inFile = TestPath + "example1.pdf";
PdfFileSignature pdfSign = new PdfFileSignature();
pdfSign.BindPdf(inFile);
IList names = pdfSign.GetSignNames();
for(int i = 0; i < names.Count; i++)
{
pdfSign.RemoveSignature((string)names[i], false);
}
pdfSign.Save(TestPath + "signed_removed.pdf");
[Visual Basic]
Dim pdfSign as PdfFileSignature = new PdfFileSignature
pdfSign.BindPdf(inFile)
Dim names as IList
names = pdfSign.GetSignNames()
For i = 0 To names.Count
pdfSign.RemoveSignature((string)names[i], false)
pdfSign.Save(TestPath + "signed_removed.pdf")

◆ RemoveUsageRights()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::RemoveUsageRights ( )

Removes the usage rights entry.

◆ Save() [1/3]

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::Save ( System::String  outputFile)
overridevirtual

Saves the result PDF to file.

Parameters
outputFileoutput pdf file

Reimplemented from Aspose::Pdf::Facades::SaveableFacade.

◆ Save() [2/3]

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::Save ( System::SharedPtr< System::IO::Stream outputStream)
overridevirtual

Saves the result PDF to stream.

Parameters
outputStreamoutput pdf stream

Reimplemented from Aspose::Pdf::Facades::SaveableFacade.

◆ Save() [3/3]

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::Save ( )

Save signed pdf file. Output filename must be provided before with the help of coresponding PdfFileSignature constructor.

Deprecated:
Please, use Save method with parameter.

◆ set_SignatureAppearance()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::set_SignatureAppearance ( System::String  value)

Sets or gets a graphic appearance for the signature. Property value represents image file name.

◆ set_SignatureAppearanceStream()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::set_SignatureAppearanceStream ( System::SharedPtr< System::IO::Stream value)

Sets or gets a graphic appearance for the signature. Property value represents image stream.

◆ SetCertificate()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::SetCertificate ( System::String  pfx,
System::String  pass 
)

Set certificate file and password for signing routine.

Parameters
pfxPKCS #12 certificate file.
passPassword to get access for the certificate private key.

◆ Sign() [1/6]

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::Sign ( int32_t  page,
System::String  SigReason,
System::String  SigContact,
System::String  SigLocation,
bool  visible,
System::Drawing::Rectangle  annotRect 
)

Make a signature on the pdf document.

Parameters
pageThe page number on which signature is made.
SigReasonThe reason of signature.
SigContactThe contact of signature.
SigLocationThe location of signature.
visibleThe visiblity of signature.
annotRectThe rect of signature.
[C#]
string inFile = TestPath + "example1.pdf";
string outFile = TestPath + "signature.pdf";
PdfFileSignature pdfSign = new PdfFileSignature();
pdfSign.BindPdf(inFile);
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 200, 200);
pdfSign.SignatureAppearance = TestPath + "butterfly.jpg";
pdfSign.SetCertificate("certificate.pfx", "password");
pdfSign.Sign(2, "Allen", "success", "ChangSha", true, rect);
pdfSign.Save(outFile);
[Visual Basic]
Dim pdfSign = new PdfFileSignature()
pdfSign.BindPdf(inFile)
Dim rect as System.Drawing.Rectangle = new System.Drawing.Rectangle(100, 100, 200, 200)
pdfSign.SetCertificate("certificate.pfx", "password")
pdfSign.Sign(2, "Allen", "success", "ChangSha", true, rect)
pdfSign.SignatureAppearance = TestPath + "butterfly.jpg"
pdfSign.Save(outFile)

◆ Sign() [2/6]

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::Sign ( int32_t  page,
System::String  SigReason,
System::String  SigContact,
System::String  SigLocation,
bool  visible,
System::Drawing::Rectangle  annotRect,
System::SharedPtr< Aspose::Pdf::Forms::Signature sig 
)

Sign the document with the given type signature.

Parameters
pageThe page number on which signature is made.
SigReasonThe reason of signature.
SigContactThe contact of signature.
SigLocationThe location of signature.
visibleThe visiblity of signature.
annotRectThe rect of signature.
sigThe type of the signature, could be PKCS1, PKCS7 and PKCS7Detached.
[C#]
string inFile = TestPath + "example1.pdf";
string outFile = TestPath + "signature.pdf";
PdfFileSignature pdfSign = new PdfFileSignature(inFile, outFile);
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 200, 100);
pdfSign.SignatureAppearance = TestPath + "butterfly.jpg";
pdfSign.Sign(2, "Allen", "success", "ChangSha", true, rect, new PKCS1("certificate.pfx", "password"));
pdfSign.Save();
[Visual Basic]
Dim inFile As String = TestPath &amp; "example1.pdf"
Dim outFile As String = TestPath &amp; "signature.pdf"
Dim sig As PKCS1 = new PKCS1("certificate.pfx", "password")
Dim pdfSign = new PdfFileSignature(inFile, outFile)
Dim rect as System.Drawing.Rectangle = new System.Drawing.Rectangle(100, 100, 200, 100)
pdfSign.SignatureAppearance = TestPath &amp; "butterfly.jpg"
pdfSign.Sign(2, "Allen", "success", "ChangSha", true, rect, sig)
pdfSign.Save()

◆ Sign() [3/6]

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::Sign ( int32_t  page,
bool  visible,
System::Drawing::Rectangle  annotRect,
System::SharedPtr< Aspose::Pdf::Forms::Signature sig 
)

Sign the document with the given type signature.

Parameters
pageThe page number on which signature is made.
visibleThe visiblity of signature.
annotRectThe rect of signature.
sigThe type of the signature, could be PKCS1, PKCS7 and PKCS7Detached. Such data as signature reason, contact and location must be already present in this object (see corresponding properties).
[C#]
string inFile = TestPath + "example1.pdf";
string outFile = TestPath + "signature.pdf";
PKCS1 sig = new PKCS1("certificate.pfx", "password");
sig.Reason = "Some reason";
sig.Contact = "Smith";
sig.Location = "New York";
PdfFileSignature pdfSign = new PdfFileSignature(inFile, outFile);
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 200, 100);
pdfSign.SignatureAppearance = TestPath + "butterfly.jpg";
pdfSign.Sign(2, true, rect, sig);
pdfSign.Save();
[Visual Basic]
Dim inFile As String = TestPath &amp; "example1.pdf"
Dim outFile As String = TestPath &amp; "signature.pdf"
Dim sig As PKCS1 = new PKCS1("certificate.pfx", "password")
sig.Reason = "Some reason"
sig.Contact = "Smith"
sig.Location = "New York"
Dim pdfSign = new PdfFileSignature(inFile, outFile)
Dim rect as System.Drawing.Rectangle = new System.Drawing.Rectangle(100, 100, 200, 100)
pdfSign.SignatureAppearance = TestPath &amp; "butterfly.jpg"
pdfSign.Sign(2, true, rect, sig)
pdfSign.Save()

◆ Sign() [4/6]

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::Sign ( System::String  SigName,
System::String  SigReason,
System::String  SigContact,
System::String  SigLocation,
System::SharedPtr< Aspose::Pdf::Forms::Signature sig 
)

Sign the document with the given type signature which is placed in already presented signature field. Before signing signature field must be empty, i.e. field must not contain signature dictionary. Thus pdf document already has signature field, you should not supply the place to stamp the signature, corresponding page and rectangle are taken from signature field which is found by signature name (see SigName parameter).

Parameters
SigNameThe name of the signature field.
SigReasonThe reason of signature.
SigContactThe contact of signature.
SigLocationThe location of signature.
sigThe type of the signature, could be PKCS1, PKCS7 and PKCS7Detached.
[C#]
string inFile = TestPath + "example1.pdf";
string outFile = TestPath + "signature.pdf";
PKCS1 sig = new PKCS1("certificate.pfx", "password");
PdfFileSignature pdfSign = new PdfFileSignature(inFile, outFile);
pdfSign.SignatureAppearance = TestPath + "butterfly.jpg";
pdfSign.Sign("Signature1", "Allen", "success", "ChangSha", sig);
pdfSign.Save();
[Visual Basic]
Dim inFile As String = TestPath &amp; "example1.pdf"
Dim outFile As String = TestPath &amp; "signature.pdf"
Dim sig As PKCS1 = new PKCS1("certificate.pfx", "password")
Dim pdfSign = new PdfFileSignature(inFile, outFile)
pdfSign.SignatureAppearance = TestPath &amp; "butterfly.jpg"
pdfSign.Sign("Signature1", "Allen", "success", "ChangSha", sig)
pdfSign.Save()

◆ Sign() [5/6]

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::Sign ( int32_t  page,
System::String  SigName,
System::String  SigReason,
System::String  SigContact,
System::String  SigLocation,
bool  visible,
System::Drawing::Rectangle  annotRect,
System::SharedPtr< Aspose::Pdf::Forms::Signature sig 
)

Sign the document with the given type signature which is placed in already presented signature field. Before signing pdf document should already has signature field, corresponding page and rectangle are taken from signature field which is found by signature name (see SigName parameter).

Parameters
pageThe page number on which signature is made.
SigNameThe name of the signature field.
SigReasonThe reason of signature.
SigContactThe contact of signature.
SigLocationThe location of signature.
visibleThe visiblity of signature.
annotRectThe rect of signature.
sigThe type of the signature, could be PKCS1, PKCS7 and PKCS7Detached.
[C#]
string inFile = TestPath + "blankWithSignature.pdf";
string outFile = TestPath + "signature.pdf";
PKCS7 sig = new PKCS7("certificate.pfx", "password");
PdfFileSignature pdfSign = new PdfFileSignature(inFile);
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 100, 100);
pdfSign.SignatureAppearance = TestPath + "butterfly.jpg"
pdfSign.Sign(1, "Signature1", "ReasonToTest", "ContactMe", "SomeLocation", true, rect, sig);
pdfSign.Save(outFile);
[Visual Basic]
Dim inFile As String = TestPath &amp; "blankWithSignature.pdf"
Dim outFile As String = TestPath &amp; "signature.pdf"
Dim sig As PKCS7 = new PKCS7("certificate.pfx", "password")
Dim pdfSign = new PdfFileSignature(inFile, outFile)
pdfSign.SignatureAppearance = TestPath &amp; "butterfly.jpg"
pdfSign.Sign("Signature1", "ReasonToTest", "ContactMe", "SomeLocation", true, rect, sig)
pdfSign.Save(outFile)

◆ Sign() [6/6]

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Facades::PdfFileSignature::Sign ( System::String  SigName,
System::SharedPtr< Aspose::Pdf::Forms::Signature sig 
)

Sign the document with the given type signature which is placed in already presented signature field. Before signing signature field must be empty, i.e. field must not contain signature dictionary. Thus pdf document already has signature field, you should not supply the place to stamp the signature, corresponding page and rectangle are taken from signature field which is found by signature name (see SigName parameter). Such data as signature reason, contact and location must be provided by corresponding properties of the Signature object sig.

Parameters
SigNameThe name of the signature field.
sigThe type of the signature, could be PKCS1 (Pkcs1Signature object), PKCS7 and PKCS7 detached (Pkcs7Signature object)
[C#]
string inFile = TestPath + "example1.pdf";
string outFile = TestPath + "signature.pdf";
PKCS1 sig = new PKCS1("certificate.pfx", "password");
sig.Reason = "Some reason";
sig.Contact = "Smith";
sig.Location = "New York";
PdfFileSignature pdfSign = new PdfFileSignature(inFile, outFile);
pdfSign.SignatureAppearance = TestPath + "butterfly.jpg";
pdfSign.Sign("Signature1", sig);
pdfSign.Save();
[Visual Basic]
Dim inFile As String = TestPath &amp; "example1.pdf"
Dim outFile As String = TestPath &amp; "signature.pdf"
Dim sig As PKCS1 = new PKCS1("certificate.pfx", "password")
sig.Reason = "Some reason"
sig.Contact = "Smith"
sig.Location = "New York"
Dim pdfSign = new PdfFileSignature(inFile, outFile)
pdfSign.SignatureAppearance = TestPath &amp; "butterfly.jpg"
pdfSign.Sign("Signature1", sig)
pdfSign.Save()

◆ VerifySignature()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Facades::PdfFileSignature::VerifySignature ( System::String  signName)

Checks the validity of a signature.

Parameters
signNameThe name of signature.
Returns
Return a result of bool type.

◆ VerifySigned()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Facades::PdfFileSignature::VerifySigned ( System::String  signName)

Checks the validity of a signature.

Parameters
signNameThe name of signature.
Returns
Return a result of bool type.