[prev in list] [next in list] [prev in thread] [next in thread]
List: bouncycastle-crypto-dev
Subject: Re: [dev-crypto] extract original file name from CMS
From: "Marcelo Alarcon " <malarcon () bcu ! gub ! uy>
Date: 2008-10-23 17:50:55
Message-ID: s9009ca1.015 () BCUMAIL ! lan ! bcu ! gub ! uy
[Download RAW message or body]
Thanks David
The filename is stored as a signer attribute. We have an application written in \
delphi that reads the file name according to the following code:
attrs := signer.AuthenticatedAttributes;
for n:=1 to attrs.Count do
begin
if (attrs.Item[n].Name = CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME) then
documentName := attrs.Item[n].Value;
end;
We want to do the same with de following java code but the value of the attribute is \
not readable:
for (Iterator it = cms.getSignerInfos().getSigners().iterator(); it
.hasNext();) {
SignerInformation signerInformation = (SignerInformation) it.next();
SignerInfo signerInfo = signerInformation.toSignerInfo();
ASN1Set authenticatedAttributes = signerInfo
.getAuthenticatedAttributes();
for (Enumeration enu = authenticatedAttributes.getObjects(); enu
.hasMoreElements();) {
DERSequence attribute = (DERSequence) enu.nextElement();
logger.info("attribute=" + attribute);
}
}
the output is:
attribute=[1.3.6.1.4.1.311.88.2.2, [#]]
attribute=[1.2.840.113549.1.9.3, [1.2.840.113549.1.7.1]]
attribute=[1.2.840.113549.1.9.5, [071022182628Z]]
attribute=[1.2.840.113549.1.9.4, [#144a30cf9be097c72890ace4bc89fd4e0cefcf36]]
attribute=[1.3.6.1.4.1.311.88.2.1, \
[#320030002e0020005700650062005300650072007600690063006500730020004a006100760061002e00700064006600]]
Regards,
Marcelo
Ing. Wilman Marcelo Alarcón
Área Sistemas de Información
Banco Central del Uruguay
malarcon@bcu.gub.uy
tel: (5982) 1967 2066 o 1967 2068
> > > David Hook <dgh@lockboxlabs.com> 22/10/2008 21:23 >>>
Unless the file name has been stored as an attribute, there is no
provision for this information (i.e. it needs to be explicitly added)
regards,
David
On Wed, 2008-10-22 at 16:40 -0300, Marcelo Alarcon wrote:
> I am using Bouncy Castle version 1.37.0 and java 1.5. I would like
> to know how can I extract the original document file name from a CMS
> signed file?
>
> Thanks
>
> Marcelo.
>
>
> Ing. Wilman Marcelo Alarcón
> Área Sistemas de Información
> Banco Central del Uruguay
> malarcon@bcu.gub.uy
> tel: (5982) 1967 2066 o 1967 2068
> --------------------------------------------------------------------------------------------------------------------------- \
>
> La información contenida en este mensaje es para uso exclusivo del
> destinatario y demás autorizados a recibirla. Si usted ha recibido
> este e-mail por error, comuníquelo inmediatamente por esta vía y
> elimínelo de su sistema. Si Ud. no es el destinatario especificado en
> el mensaje, cualquier revelación, copia o distribución de su contenido
> está estrictamente prohibido. El mensaje expresa la opinión de su
> autor pero no necesariamente expresa la opinión oficial del Banco
> Central del Uruguay.
>
> The information included on this message is intended only for the
> personal and confidential use of the designated recipient(s) named
> above. If you have received it by mistake please let us know by e-mail
> immediately and destroy or delete it from your files or system. If you
> are not the designated recipient, any disclose, copy or distribution
> of its contents is prohibited. This message reflects the opinion of
> its author but not necessarily express an official statement of the
> BCU.
>
---------------------------------------------------------------------------------------------------------------------------------------
La información contenida en este mensaje es para uso exclusivo del destinatario y \
demás autorizados a recibirla. Si usted ha recibido este e-mail por error, \
comuníquelo inmediatamente por esta vía y elimínelo de su sistema. Si Ud. no es el \
destinatario especificado en el mensaje, cualquier revelación, copia o distribución \
de su contenido está estrictamente prohibido. El mensaje expresa la opinión de su \
autor pero no necesariamente expresa la opinión oficial del Banco Central del \
Uruguay.
The information included on this message is intended only for the personal and \
confidential use of the designated recipient(s) named above. If you have received it \
by mistake please let us know by e-mail immediately and destroy or delete it from \
your files or system. If you are not the designated recipient, any disclose, copy or \
distribution of its contents is prohibited. <<>>
[Attachment #3 (text/html)]
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16705" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>Thanks David</DIV>
<DIV> </DIV>
<DIV>The filename is stored as a signer attribute. We have an application written in \
delphi that reads the file name according to the following code: \
</DIV> <DIV> </DIV>
<DIV><FONT face="Courier New">attrs := signer.AuthenticatedAttributes;<BR>for n:=1 to \
attrs.Count do<BR>begin<BR> if (attrs.Item[n].Name = \
CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME) then <BR> \
documentName := attrs.Item[n].Value;<BR>end;</FONT><BR></DIV> <DIV> </DIV>
<DIV>We want to do the same with de following java code but the value of the \
attribute is not readable:</DIV> <DIV> </DIV>
<DIV><FONT face="Courier New">for (Iterator it = \
cms.getSignerInfos().getSigners().iterator(); it<BR> .hasNext();) \
{</FONT></DIV> <DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"> SignerInformation signerInformation = \
(SignerInformation) it.next();</FONT></DIV> <DIV><FONT face="Courier \
New"></FONT> </DIV> <DIV><FONT face="Courier New"> SignerInfo signerInfo = \
signerInformation.toSignerInfo();</FONT></DIV> <DIV><FONT face="Courier \
New"></FONT> </DIV> <DIV><FONT face="Courier New"> ASN1Set \
authenticatedAttributes = signerInfo<BR> \
.getAuthenticatedAttributes();</FONT></DIV> <DIV><FONT face="Courier \
New"></FONT> </DIV> <DIV><FONT face="Courier New"> for (Enumeration enu = \
authenticatedAttributes.getObjects(); enu<BR> \
.hasMoreElements();) {<BR> DERSequence attribute = (DERSequence) \
enu.nextElement();<BR> logger.info("attribute=" + \
attribute);<BR> }<BR>}</FONT></DIV> <DIV> </DIV>
<DIV> </DIV>
<DIV>the output is:</DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New">attribute=[1.3.6.1.4.1.311.88.2.2, \
[#]]<BR>attribute=[1.2.840.113549.1.9.3, \
[1.2.840.113549.1.7.1]]<BR>attribute=[1.2.840.113549.1.9.5, \
[071022182628Z]]<BR>attribute=[1.2.840.113549.1.9.4, \
[#144a30cf9be097c72890ace4bc89fd4e0cefcf36]]<BR>attribute=[1.3.6.1.4.1.311.88.2.1, \
[#320030002e0020005700650062005300650072007600690063006500730020004a006100760061002e00700064006600]]<BR></FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV>Regards,</DIV>
<DIV> </DIV>
<DIV>Marcelo</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Ing. Wilman Marcelo Alarcón <BR>Área Sistemas de Información<BR>Banco Central \
del Uruguay<BR><A href="mailto:malarcon@bcu.gub.uy">malarcon@bcu.gub.uy</A><BR>tel: \
(5982) 1967 2066 o 1967 2068<BR><BR>>>> David Hook \
<dgh@lockboxlabs.com> 22/10/2008 21:23 >>><BR></DIV> <DIV \
style="COLOR: #000000"><BR>Unless the file name has been stored as an attribute, \
there is no<BR>provision for this information (i.e. it needs to be explicitly \
added)<BR><BR>regards,<BR><BR>David<BR><BR>On Wed, 2008-10-22 at 16:40 -0300, Marcelo \
Alarcon wrote:<BR>> I am using Bouncy Castle version 1.37.0 and java 1.5. I \
would like<BR>> to know how can I extract the original document file name from a \
CMS<BR>> signed file?<BR>> <BR>> Thanks <BR>> <BR>> \
Marcelo. <BR>> <BR>> <BR>> Ing. Wilman Marcelo Alarcón <BR>> \
Área Sistemas de Información<BR>> Banco Central del Uruguay<BR>> \
malarcon@bcu.gub.uy<BR>> tel: (5982) 1967 2066 o 1967 2068<BR>> \
--------------------------------------------------------------------------------------------------------------------------- \
<BR>> <BR>> La información contenida en este mensaje es para uso exclusivo \
del<BR>> destinatario y demás autorizados a recibirla. Si usted ha \
recibido<BR>> este e-mail por error, comuníquelo inmediatamente por esta vía \
y<BR>> elimínelo de su sistema. Si Ud. no es el destinatario especificado \
en<BR>> el mensaje, cualquier revelación, copia o distribución de su \
contenido<BR>> está estrictamente prohibido. El mensaje expresa la opinión de \
su<BR>> autor pero no necesariamente expresa la opinión oficial del Banco<BR>> \
Central del Uruguay. <BR>> <BR>> The information included on this message is \
intended only for the<BR>> personal and confidential use of the designated \
recipient(s) named<BR>> above. If you have received it by mistake please let us \
know by e-mail<BR>> immediately and destroy or delete it from your files or \
system. If you<BR>> are not the designated recipient, any disclose, copy or \
distribution<BR>> of its contents is prohibited. This message reflects the opinion \
of<BR>> its author but not necessarily express an official statement of \
the<BR>> BCU.<BR>> <BR><BR><BR></DIV></BODY></HTML>
<p>---------------------------------------------------------------------------------------------------------------------------
</p>
<p><font size="2" face="Times New Roman">
La información contenida en este mensaje es para uso exclusivo del destinatario y \
demás autorizados a recibirla. Si usted ha recibido este e-mail por error, \
comuníquelo inmediatamente por esta vía y elimínelo de su sistema. Si Ud. no es el \
destinatario especificado en el mensaje, cualquier revelación, copia o distribución \
de su contenido está estrictamente prohibido. El mensaje expresa la opinión de su \
autor pero no necesariamente expresa la opinión oficial del Banco Central del \
Uruguay. </font>
</p>
<p><font size="2" face="Times New Roman">
The information included on this message is intended only for the personal and \
confidential use of the designated recipient(s) named above. If you have received it \
by mistake please let us know by e-mail immediately and destroy or delete it from \
your files or system. If you are not the designated recipient, any disclose, copy or \
distribution of its contents is prohibited. This message reflects the opinion of its \
author but not necessarily express an official statement of the BCU.</font>
</p>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic