To: java-security@web2.javasoft.com
Message-Id: <004d01bda061$0b36bb10$46265c87@atlantis.hr-firewalls.lucent.com>
From: "Jatinder Bali" <jbali@lucent.com>
Subject: Re: Processing CSR requests ...
Date: Thu, 25 Jun 1998 13:45:28 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_004A_01BDA03F.83B71700
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello,
I can generate a certificate for any file in JDK1.1.5 using the =
following code :
String s =3D assertProp("signature.file", properties);
if(s =3D=3D null)
return false;
s =3D s.toUpperCase();
String s1 =3D file.getName();
String s2 =3D properties.getProperty("out.file");
if(s2 =3D=3D null || s2.equals(s1))
s2 =3D s1 + ".sig";
File file1 =3D new File(s2);
FileInputStream fileinputstream =3D new FileInputStream(file);
FileOutputStream fileoutputstream =3D new =
FileOutputStream(certificateFile);
PrintStream printstream =3D new PrintStream(fileoutputstream);
byte abyte0[] =3D getBytesToEOF(fileinputstream);
PKCS7 pkcs7 =3D computeSignatures(abyte0, properties);
pkcs7.encodeSignedData(printstream);
out.println("Written signature for file \"" + s1 + "\"" + "in =
file \"" + s2 + "\"");
fileinputstream.close();
printstream.close();
My problem is how do I verify it. Could you provide me with some =
pointers.
My certificate file contains :
PKCS7 :: version: 01
PKCS7 :: digest AlgorithmIds:
[SHA]
Content Info Sequence
Content type: 1.2.840.1113549.1.7.1
Content: [DerValue, tag =3D 4, length =3D 3192]
PKCS7 :: certificates:
0. [
X.509v01 certificate,
Subject is CN=3DDuke, OU=3D"JavaSoft ", O=3DSun MicroSystems, C=3DUS
Key: Sun DSA Public Key
parameters:
p: =
fca682ce8e12caba26efccf7110e526db078b05edecbcd1eb4a208f3ae1617ae01f35b91a=
47e6
df63413c5e12ed0899bcd132acd50d99151bdc43ee737592e17
q: 962eddcc369cba8ebb260ee6b6a126d9346e38c5
g: =
678471b27a9cf44ee91a49c5147db1a9aaf244f05a434d6486931d2d14271b9e35030b71f=
d73d
a179069b32e2935630e1c2062354d0da20a6c416e50be794ca4
y: =
59304defc183ab116c1184e4a906faa6f9587995c300c9c7bab4436cf4f74182ba82da633=
3af0
6b7333d3e0dc252a9d107a09660bc509ba540168231ef7c9422
Validity <Mon Apr 06 20:00:00 EDT 1998> until <Fri Apr 05 19:00:00 EST =
2002>
Issuer is CN=3DDuke, OU=3D"JavaSoft ", O=3DSun MicroSystems, C=3DUS
Issuer signature used [SHA1withDSA]
Serial number =3D 03e9
]
PKCS7 :: signer infos:
0. Signer Info for (issuer): CN=3DDuke, OU=3D"JavaSoft ", =
O=3DSun MicroSystem
s, C=3DUS
version: 01
certificateSerialNumber: 03e9
digestAlgorithmId: [SHA]
digestEncryptionAlgorithmId: [SHA1withDSA]
encryptedDigest: [B@18ffde
Thanks in advance,
Jatinder
------=_NextPart_000_004A_01BDA03F.83B71700
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">