pdf file signed with SHA256withECDSA

Massa Alfonso <[email protected]> Tue, 26 Jul 2016 11:06:04 +0000
Newsgroups gmane.comp.java.lib.itext.general
Message-ID <0E92C440D7EC7B45BFDB7E440BFEBB65894B6C6A@FVG-EMB-01V-TS.UCFVG.hosted>
--===============2315700265949048490==
Content-Language: it-IT
Content-Type: multipart/alternative;
	boundary="_000_0E92C440D7EC7B45BFDB7E440BFEBB65894B6C6AFVGEMB01VTSUCFV_"

--_000_0E92C440D7EC7B45BFDB7E440BFEBB65894B6C6AFVGEMB01VTSUCFV_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,
I have a pdf file signed with Elliptic curve Digital Signature Algorithm (D=
SA) coupled with the Secure Hashing Algorithm (SHA256) algorithm (oid: 1.2.=
840.10045.4.3.2) .

When I try and verify the signature with this code (iText 5.5.9):

               PdfPKCS7 pk =3D af.verifySignature(name, "BC");

I get the following:

no such algorithm: SHA256with1.2.840.10045.4.3.2 for provider BC

Is it a wanted feature that itext does not support SHA256withECDSA?

When I modify com.itextpdf.text.pdf.security.EncryptionAlgorithms class wit=
h:

        algorithmNames.put("1.2.840.10045.4.1", "ECDSA");
        algorithmNames.put("1.2.840.10045.4.3.2", "ECDSA");
        algorithmNames.put("1.2.840.10045.4.3.3", "ECDSA");
        algorithmNames.put("1.2.840.10045.4.3.4", "ECDSA");

it seems to work.

I wonder whether this solution is correct.

Will  iText support SHA256withECDSA in future?

Best regards

Alfonso



AVVISO DI RISERVATEZZA Informazioni riservate possono essere contenute nel =
messaggio o nei suoi allegati. Se non siete i destinatari indicati nel mess=
aggio, o responsabili per la sua consegna alla persona, o se avete ricevuto=
 il messaggio per errore, siete pregati di non trascriverlo, copiarlo o inv=
iarlo ad alcuno. In tal caso vi invitiamo a cancellare il messaggio ed i su=
oi allegati. Grazie.
CONFIDENTIALITY NOTICE Confidential information may be contained in this me=
ssage or in its attachments. If you are not the addressee indicated in this=
 message, or responsible for message delivering to that person, or if you h=
ave received this message in error, you may not transcribe, copy or deliver=
 this message to anyone. In that case, you should delete this message and i=
ts attachments. Thank you.

--_000_0E92C440D7EC7B45BFDB7E440BFEBB65894B6C6AFVGEMB01VTSUCFV_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
span.StileMessaggioDiPostaElettronica17
	{mso-style-type:personal-compose;
	font-family:"Calibri",sans-serif;
	color:black;
	font-weight:normal;
	font-style:normal;
	text-decoration:none none;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"IT" link=3D"#0563C1" vlink=3D"#954F72">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span style=3D"color:black">Hi,<o:p></o:p></span></p=
>
<p class=3D"MsoNormal"><span style=3D"color:black">I have a pdf file signed=
 with Elliptic curve Digital Signature Algorithm (DSA) coupled with the Sec=
ure Hashing Algorithm (SHA256) algorithm (oid: 1.2.840.10045.4.3.2) .<o:p><=
/o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>
<p class=3D"MsoNormal"><span style=3D"color:black">When I try and verify th=
e signature with this code (iText 5.5.9):<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>
<p class=3D"MsoNormal"><span style=3D"color:black">&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PdfPKCS7 pk =
=3D af.verifySignature(name, &#8220;BC&#8221;);<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>
<p class=3D"MsoNormal"><span style=3D"color:black">I get the following:<o:p=
></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>
<p class=3D"MsoNormal" style=3D"text-indent:35.4pt"><span style=3D"color:bl=
ack">no such algorithm: SHA256with1.2.840.10045.4.3.2 for provider BC<o:p><=
/o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>
<p class=3D"MsoNormal"><span style=3D"color:black">Is it a wanted feature t=
hat itext does not support SHA256withECDSA?<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>
<p class=3D"MsoNormal"><span style=3D"color:black">When I modify com.itextp=
df.text.pdf.security.EncryptionAlgorithms class with:<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>
<p class=3D"MsoNormal"><span style=3D"color:black">&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; algorithmNames.put(&quot;1.2.840.10045.4.1&quot;, &quot;=
ECDSA&quot;);<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:black">&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; algorithmNames.put(&quot;1.2.840.10045.4.3.2&quot;, &quo=
t;ECDSA&quot;);<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:black">&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; algorithmNames.put(&quot;1.2.840.10045.4.3.3&quot;, &quo=
t;ECDSA&quot;);<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:black">&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; algorithmNames.put(&quot;1.2.840.10045.4.3.4&quot;, &quo=
t;ECDSA&quot;);<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>
<p class=3D"MsoNormal"><span style=3D"color:black">it seems to work.<o:p></=
o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>
<p class=3D"MsoNormal"><span style=3D"color:black">I wonder whether this so=
lution is correct.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>
<p class=3D"MsoNormal"><span style=3D"color:black">Will&nbsp; iText support=
 SHA256withECDSA in future?<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>
<p class=3D"MsoNormal"><span style=3D"color:black">Best regards<o:p></o:p><=
/span></p>
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>
<p class=3D"MsoNormal"><span style=3D"color:black">Alfonso<o:p></o:p></span=
></p>
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>
<p class=3D"MsoNormal"><span style=3D"color:black"><o:p>&nbsp;</o:p></span>=
</p>
</div>
<br>
AVVISO DI RISERVATEZZA Informazioni riservate possono essere contenute nel =
messaggio o nei suoi allegati. Se non siete i destinatari indicati nel mess=
aggio, o responsabili per la sua consegna alla persona, o se avete ricevuto=
 il messaggio per errore, siete
 pregati di non trascriverlo, copiarlo o inviarlo ad alcuno. In tal caso vi=
 invitiamo a cancellare il messaggio ed i suoi allegati. Grazie.
<br>
CONFIDENTIALITY NOTICE Confidential information may be contained in this me=
ssage or in its attachments. If you are not the addressee indicated in this=
 message, or responsible for message delivering to that person, or if you h=
ave received this message in error,
 you may not transcribe, copy or deliver this message to anyone. In that ca=
se, you should delete this message and its attachments. Thank you.
</body>
</html>

--_000_0E92C440D7EC7B45BFDB7E440BFEBB65894B6C6AFVGEMB01VTSUCFV_--


--===============2315700265949048490==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
--===============2315700265949048490==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
--===============2315700265949048490==--