Form of SubjectName text in PDF export
Form of SubjectName text in PDF export
Hello Ivan,
great!!! I will check it tomorrow...
Thank you and have a nice rest of day!
great!!! I will check it tomorrow...
Thank you and have a nice rest of day!
Form of SubjectName text in PDF export
Ok! Let us know about the result.
Thank you.
Thank you.
Form of SubjectName text in PDF export
Hello,
I am afraid, but DocumentExport freeze if I put correct CN value. Than I have to restart application
I am afraid, but DocumentExport freeze if I put correct CN value. Than I have to restart application

Form of SubjectName text in PDF export
Hello,
We couldn't reproduce this bug.
In the last build we use the following code:
Thank you.
We couldn't reproduce this bug.
In the last build we use the following code:
Code: Select all
#region FindCertificateInStore
if ((certificateID != null) && (certificateID != string.Empty))
{
IntPtr SIGNER_NAME = Marshal.StringToBSTR(certificateID);
int certificateIsValid = 0;
do
{
pCertContext = Win32.CertFindCertificateInStore(
hStoreHandle,
ENCODING_TYPE,
0,
Win32.CERT_FIND_SUBJECT_NAME,
SIGNER_NAME,
pCertContext);
if (pCertContext == IntPtr.Zero)
{
pCertContext = Win32.CertFindCertificateInStore(
hStoreHandle,
ENCODING_TYPE,
0,
Win32.CERT_FIND_SUBJECT_STR,
SIGNER_NAME,
pCertContext);
}
if (pCertContext == IntPtr.Zero) ThrowDigitalSignError(2, "Certificate is not found", true);
SignerCert = (Win32.CERT_CONTEXT)Marshal.PtrToStructure(pCertContext, typeof(Win32.CERT_CONTEXT));
certificateIsValid = Win32.CertVerifyTimeValidity(IntPtr.Zero, SignerCert.pCertInfo);
}
while (certificateIsValid != 0);
}
else
{
ThrowDigitalSignError(2, "Subject name string is empty");
}
#endregion
Form of SubjectName text in PDF export
Hello,
you can't use IntPtr SIGNER_NAME as value for parameter CERT_FIND_SUBJECT_STR. You have to use CertNameToStr function to convert this to CERT_NAME_BLOB ... see documentations http://msdn.microsoft.com/en-us/library ... 85%29.aspx and http://msdn.microsoft.com/en-us/library ... 85%29.aspx ...
But this is not why it freeze... because if I put your code in my test project and use CN value, it finds correctly my certificate.
It looks like you have never been debuging your code... I understand, that this issue has low priority for you
but not for me... We have to sign PDF reports and would like to use your function...
you can't use IntPtr SIGNER_NAME as value for parameter CERT_FIND_SUBJECT_STR. You have to use CertNameToStr function to convert this to CERT_NAME_BLOB ... see documentations http://msdn.microsoft.com/en-us/library ... 85%29.aspx and http://msdn.microsoft.com/en-us/library ... 85%29.aspx ...
But this is not why it freeze... because if I put your code in my test project and use CN value, it finds correctly my certificate.
It looks like you have never been debuging your code... I understand, that this issue has low priority for you

Form of SubjectName text in PDF export
Hello,
On the current moment we cannot find the certificate by by whole subjectName (CERT_FIND_SUBJECT_NAME). Maybe we do not take something into the account.
If you will improve our code, shown above, we will include these changes into our product.
Thank you.
On the current moment we cannot find the certificate by by whole subjectName (CERT_FIND_SUBJECT_NAME). Maybe we do not take something into the account.
If you will improve our code, shown above, we will include these changes into our product.
Thank you.
Form of SubjectName text in PDF export
Better way will be for you to use functionality from System.Security.Cryptography instead of using P/Invoke of crypt32.dll...
For example:
Except finding the certificate by whole subjectName is your code correct... but you have problem somewhere before this code... I cant tell you more, because we haven't licence with source code ...
For example:
Code: Select all
X509Store store = new X509Store(getStoreNameFromString(storename), StoreLocation.CurrentUser);
X509Certificate2Collection oCerts = new X509Certificate2Collection();
store.Open(OpenFlags.ReadWrite);
oCerts = (X509Certificate2Collection)store.Certificates.Find(X509FindType.FindBySubjectDistinguishedName, subjectName, false);
Form of SubjectName text in PDF export
Hello,
We made some improvements in that direction.
Please check the next prerelease build when it will be available and let us know about the result.
Thank you.
We made some improvements in that direction.
Please check the next prerelease build when it will be available and let us know about the result.
Thank you.
Form of SubjectName text in PDF export
Hello Ivan,
great... I have made ticket TIA-283906, where we can personally communicate... When it is solved, I will close this ticket. Ok?
Thank you and I will check your improvement when it will be possible..
great... I have made ticket TIA-283906, where we can personally communicate... When it is solved, I will close this ticket. Ok?
Thank you and I will check your improvement when it will be possible..