SetSignatureCertificateFromP12(String,String) Method
In This Topic
Sets up the certificate, contained in the digital ID stored in the specified external PKCS#12 file with the filename extension ".p12" or ".pfx". This
certificate is later used for the subsequent signing of the currently loaded PDF document. The method works with the file specified by its file path as a string.
Syntax
'Declaration
Public Overloads Function SetSignatureCertificateFromP12( _
ByVal As String, _
ByVal As String _
) As GdPictureStatus
public GdPictureStatus SetSignatureCertificateFromP12(
string ,
string
)
public function SetSignatureCertificateFromP12(
: String;
: String
): GdPictureStatus;
public function SetSignatureCertificateFromP12(
: String,
: String
) : GdPictureStatus;
public: GdPictureStatus SetSignatureCertificateFromP12(
string* ,
string*
)
public:
GdPictureStatus SetSignatureCertificateFromP12(
String^ ,
String^
)
Parameters
- CertPath
- The file path to the digital ID file. This file contains the certificate to be used for the subsequent signing.
- PFXPassword
- The password to open the digital ID file specified above.
Return Value
A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.
We strongly recommend always checking this status first.
Example
How to set up the certificate (digital ID) from the external file for the subsequent signing.
You can find the complete sample within the ApplySignature() method's example.
Dim caption As String = "SetSignatureCertificateFromP12"
Dim gdpicturePDF As New GdPicturePDF()
'Please load the PDF document you want to sign.
'This is the first step in the signing process. It is the mandatory step. Select the method according to your preference.
Dim status As GdPictureStatus = gdpicturePDF.SetSignatureCertificateFromP12("your-digitalID-file.pfx", "your-password")
If status <> GdPictureStatus.OK Then
MessageBox.Show("The method SetSignatureCertificateFromP12() has failed with the status: " + status.ToString(), caption)
Goto [Error]
End If
'Please see the complete sample in the ApplySignature() method for next steps to follow.
[error]:
gdpicturePDF.Dispose()
string caption = "SetSignatureCertificateFromP12";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
//Please load the PDF document you want to sign.
//This is the first step in the signing process. It is the mandatory step. Select the method according to your preference.
GdPictureStatus status = gdpicturePDF.SetSignatureCertificateFromP12("your-digitalID-file.pfx", "your-password");
if (status != GdPictureStatus.OK)
{
MessageBox.Show("The method SetSignatureCertificateFromP12() has failed with the status: " + status.ToString(), caption);
goto error;
}
//Please see the complete sample in the ApplySignature() method for next steps to follow.
error:
gdpicturePDF.Dispose();
Example
How to set up the certificate (digital ID) from the external file for the subsequent signing.
You can find the complete sample within the ApplySignature() method's example.
Dim caption As String = "SetSignatureCertificateFromP12"
Dim gdpicturePDF As New GdPicturePDF()
'Please load the PDF document you want to sign.
'This is the first step in the signing process. It is the mandatory step. Select the method according to your preference.
Dim status As GdPictureStatus = gdpicturePDF.SetSignatureCertificateFromP12("your-digitalID-file.pfx", "your-password")
If status <> GdPictureStatus.OK Then
MessageBox.Show("The method SetSignatureCertificateFromP12() has failed with the status: " + status.ToString(), caption)
Goto [Error]
End If
'Please see the complete sample in the ApplySignature() method for next steps to follow.
[error]:
gdpicturePDF.Dispose()
string caption = "SetSignatureCertificateFromP12";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
//Please load the PDF document you want to sign.
//This is the first step in the signing process. It is the mandatory step. Select the method according to your preference.
GdPictureStatus status = gdpicturePDF.SetSignatureCertificateFromP12("your-digitalID-file.pfx", "your-password");
if (status != GdPictureStatus.OK)
{
MessageBox.Show("The method SetSignatureCertificateFromP12() has failed with the status: " + status.ToString(), caption);
goto error;
}
//Please see the complete sample in the ApplySignature() method for next steps to follow.
error:
gdpicturePDF.Dispose();
See Also