How did you do it?

Max Wolf (max.wolf@usa.net)
Thu, 07 Jan 1999 16:29:24 -0800

This is a multi-part message in MIME format.

--Boundary_(ID_k1Gt10Trgvnu/u7pTq80DQ)
Content-type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi.
I tried to create an applet that would read from the system Clipboard.
I did all steps listed in the example @
http://java.sun.com/security/signExample/
I also tested the applet on the local machine.

But when I put the html file and the signed jar file to the server,
it doesn't work giving me the following messages:

# Error: Invalid Hash of this JAR entry (-7882)
# jar file: C:\WINDOWS\TEMP\jzip8PHA.TMP
# path: ClipboardApplet.class
# Error: Strange PKCS7 or RSA failure (-7881)
# jar file: C:\WINDOWS\TEMP\jzip8PHA.TMP
# path: C:\WINDOWS\TEMP\jzip8PHA.TMP
# Error: loading of signatures has failed (-1)
# jar file: C:\WINDOWS\TEMP\jzip8PHA.TMP
# path: /
Getting the system clipboard
security.checksystemclipboardaccess

However, I was able to make your example work.
What am I doing wrong?
Please, help.

Attached are the files I used.
Thank you.
Max.

--Boundary_(ID_k1Gt10Trgvnu/u7pTq80DQ)
Content-type: text/plain; name=sign_directive; charset=us-ascii
Content-disposition: inline; filename=sign_directive
Content-Transfer-Encoding: 7bit

# Jar signing directive. This is the directive file used by javakey to
# sign a jar file.

# Which signer to use. This must be in the system's database.
signer=MIcertID

# Cert number to use for this signer. This determines which
# certificate will be included in the PKCS7 block. This is mandatory
# and is 1 based.
cert=1

# Cert chain depth of a chain of certificate to include. This is
# currently not supported.
chain=0

# The name to give to the signature file and associated signature
# block. (i.e. DUKESIGN.SF and DUKESIGN.DSA). This must be 8
# characters or less.
signature.file=MIsign

--Boundary_(ID_k1Gt10Trgvnu/u7pTq80DQ)
Content-type: application/x-unknown-content-type-batfile; name=2regCert.bat
Content-disposition: inline; filename=2regCert.bat
Content-Transfer-Encoding: base64

amF2YWtleSByIE1JY2VydElEDQpqYXZha2V5IC1jIE1JY2VydElEIHRydWUNCmphdmFrZXkg
LWljIE1JY2VydElEIE1JY2VydGlmaWNhdGUueDUwOQ0KY29weSBjOlx2aXN1YWx+MVxqYXZh
XGlkZW50aXR5ZGIub2JqIEM6XFdpbmRvd3NcKi4qIC9Z

--Boundary_(ID_k1Gt10Trgvnu/u7pTq80DQ)
Content-type: text/plain; name=cert_directive; charset=us-ascii
Content-disposition: inline; filename=cert_directive
Content-Transfer-Encoding: 7bit

# This is a sample certificate directive file.

# the id of the signer
issuer.name=MIcertID

# the cert to use for the signing
issuer.cert=1

# the id of the subject
subject.name=MIcertID

# the components of the X500 name for the subject
subject.real.name=Masters Institute
subject.org.unit=JavaSoft
subject.org=Sun Microsystems
subject.country=US

# Various parameters: start and end date for validity and expiration
# of the certificate. Serial number. FIle to which to output the
# certificate (optional).
start.date=1 Jan 1999
end.date=1 Apr 2099
serial.number=1001
out.file=MIcertificate.x509

--Boundary_(ID_k1Gt10Trgvnu/u7pTq80DQ)
Content-type: text/html; name=Clipboard.html; charset=us-ascii
Content-disposition: inline; filename=Clipboard.html
Content-Transfer-Encoding: 7bit

Autogenerated HTML

--Boundary_(ID_k1Gt10Trgvnu/u7pTq80DQ)
Content-type: application/x-unknown-content-type-VisualCafeFile.Document;
name=ClipboardApplet.java
Content-disposition: inline; filename=ClipboardApplet.java
Content-Transfer-Encoding: base64

LyoqIENsaXBib2FyZEFwcGxldC5qYXZhIA0KICogVGhpcyBhcHBsZXQgc2hvdWxkIHNob3cg
dGhlIENsaXBib2FyZCBjb250ZW50cyANCiAqIGlmIHRoZXJlIGlzIHNvbWUgU3RyaW5nLXR5
cGUgZGF0YSBpbiBpdA0KICovDQppbXBvcnQgamF2YS5hd3QuKjsNCmltcG9ydCBqYXZhLmFw
cGxldC4qOw0KaW1wb3J0IGphdmEuYXd0LmRhdGF0cmFuc2Zlci4qOw0KDQpwdWJsaWMgY2xh
c3MgQ2xpcGJvYXJkQXBwbGV0IGV4dGVuZHMgQXBwbGV0ew0KCXB1YmxpYyB2b2lkIGluaXQo
KXsNCgkgICAgc2V0TGF5b3V0KG51bGwpOw0KCSAgICBzZXRTaXplKDUwMCwyMDApOw0KCSAg
ICB0ZXh0QXJlYTEgPSBuZXcgamF2YS5hd3QuVGV4dEFyZWEoKTsNCgkgICAgdGV4dEFyZWEx
LnNldEJvdW5kcygwLDAsNTAwLDIwMCk7DQoJICAgIGFkZCh0ZXh0QXJlYTEpOw0KCQ0KCSAg
ICB0cnl7DQoJICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkdldHRpbmcgdGhlIHN5c3Rl
bSBjbGlwYm9hcmRcbiIpOw0KCSAgICAgICAgQ2xpcGJvYXJkIGNiID0gVG9vbGtpdC5nZXRE
ZWZhdWx0VG9vbGtpdCgpLmdldFN5c3RlbUNsaXBib2FyZCgpOw0KCSAgICAgICAgU3lzdGVt
Lm91dC5wcmludGxuKCJHZXR0aW5nIHRoZSBjb250ZW50c1xuIik7DQoJICAgICAgICBUcmFu
c2ZlcmFibGUgdCA9IGNiLmdldENvbnRlbnRzKHRoaXMpOw0KCSAgICAgICAgU3lzdGVtLm91
dC5wcmludGxuKCJEaXNwbGF5aW5nIHRoZSBkYXRhXG4iKTsNCgkJdGV4dEFyZWExLnNldFRl
eHQoKFN0cmluZyl0LmdldFRyYW5zZmVyRGF0YShEYXRhRmxhdm9yLnN0cmluZ0ZsYXZvcikp
Ow0KCSAgICB9Y2F0Y2goRXhjZXB0aW9uIGUpew0KCSAgICAgICAgU3lzdGVtLm91dC5wcmlu
dGxuKGUuZ2V0TWVzc2FnZSgpKTsNCgkgICAgfQ0KCX0NCg0KCWphdmEuYXd0LlRleHRBcmVh
IHRleHRBcmVhMTsNCn0NCg==

--Boundary_(ID_k1Gt10Trgvnu/u7pTq80DQ)
Content-type: application/x-unknown-content-type-batfile; name=1signCert.bat
Content-disposition: inline; filename=1signCert.bat
Content-Transfer-Encoding: base64

amF2YWtleSByIE1JY2VydElEDQpqYXZha2V5IC1jcyBNSWNlcnRJRA0KamF2YWtleSAtZ2sg
TUljZXJ0SUQgRFNBIDUxMiBNSWNlcnRJRF9wdWIgTUljZXJ0SURfcHJpdg0KamF2YWtleSAt
Z2MgY2VydF9kaXJlY3RpdmUNCmphciBjZiBjbGlwYnJkLmphciBDbGlwYm9hcmRBcHBsZXQu
Y2xhc3MgQ2xpcGJvYXJkLmh0bWwNCmphdmFrZXkgLWdzIHNpZ25fZGlyZWN0aXZlIGNsaXBi
cmQuamFy

--Boundary_(ID_k1Gt10Trgvnu/u7pTq80DQ)--