Understanding Signing and Verification (2024)

The JavaTM platform enables you to digitally sign JAR files. You digitally sign a file for the same reason you might sign a paper document with pen and ink -- to let readers know that you wrote the document, or at least that the document has your approval.

When you sign a letter, for example, everyone who recognizes your signature can confirm that you wrote the letter. Similarly when you digitally sign a file, anyone who "recognizes" your digital signature knows that the file came from you. The process of "recognizing" electronic signatures is called verification.

The ability to sign and verify files is an important part of the Java platform's security architecture. Security is controlled by the security policy that's in force at runtime. You can configure the policy to grant security privileges to applets and to applications. For example, you could grant permission to an applet to perform normally forbidden operations such as reading and writing local files or running local executable programs. If you have downloaded some code that's signed by a trusted entity, you can use that fact as a criterion in deciding which security permissions to assign to the code.

Once you (or your browser) have verified that an applet is from a trusted source, you can have the platform relax security restrictions to let the applet perform operations that would ordinarily be forbidden. A trusted applet can have freedoms as specified by the policy file in force.

The Java platform enables signing and verification by using special numbers called public and private keys. Public keys and private keys come in pairs, and they play complementary roles.

The private key is the electronic "pen" with which you can sign a file. As its name implies, your private key is known only to you so that no one else can "forge" your signature.A file signed with your private key can be verified only by the corresponding public key.

Public and private keys alone, however, aren't enough to truly verify a signature. Even if you've verified that a signed file contains a matching key pair, you still need some way to confirm that the public key actually comes from the signer that it purports to come from.

One more element, therefore, is required to make signing and verification work. That additional element is the certificate that the signer includes in a signed JAR file. A certificate is a digitally signed statement from a recognized certification authority that indicates who owns a particular public key. A certification authority are entities (typically firms specializing in digital security) that are trusted throughout the industry to sign and issue certificates for keys and their owners. In the case of signed JAR files, the certificate indicates who owns the public key contained in the JAR file.

When you sign a JAR file your public key is placed inside the archive along with an associated certificate so that it's easily available for use by anyone wanting to verify your signature.

To summarize digital signing:

  • the signer signs the JAR file using a private key.
  • the corresponding public key is placed in the JAR file, together with its certificate, so that it's available for use by anyone who wants to verify the signature.
When you sign a JAR file, each file in the archive is given a digest entry in the archive's manifest. Here's an example of what such an entry might look like:
Name: test/classes/ClassOne.classSHA1-Digest: TD1GZt8G11dXY2p4olSZPc5Rj64=
The digest values are hashes or encoded representations of the contents of the files as they were at the time of signing. A file's digest will change if and only if the file itself changes.

When a JAR file is signed, a signature file is automatically generated and placed in the JAR file's META-INF directory, the same directory that contains the archive's manifest. Signature files have filenames with an .SF extension. Here is an example of the contents of a signature file:

Signature-Version: 1.0SHA1-Digest-Manifest: h1yS+K9T7DyHtZrtI+LxvgqaMYM=Created-By: SignatureFile JDK 1.2Name: test/classes/ClassOne.classSHA1-Digest: fcav7ShIG6i86xPepmitOVo4vWY=Name: test/classes/ClassTwo.classSHA1-Digest: xrQem9snnPhLySDiZyclMlsFdtM=Name: test/images/ImageOne.gifSHA1-Digest: kdHbE7kL9ZHLgK7akHttYV4XIa0=Name: test/images/ImageTwo.gifSHA1-Digest: mF0D5zpk68R4oaxEqoS9Q7nhm60=

As you can see, the signature file contains digest entries for the archive's files that look similar to the digest-value entries in the manifest. However, while the digest values in the manifest are computed from the files themselves, the digest values in the signature file are computed from the corresponding entries in the manifest. Signature files also contain a digest value for the entire manifest (see the SHA1-Digest-Manifest header in the above example).

When a signed JAR file is being verified, the digests of each of its files are re-computed and compared with the digests recorded in the manifest to ensure that the contents of the JAR file haven't changed since it was signed. As an additional check, digest values for the manifest file itself are re-computed and compared against the values recorded in the signature file.

You can read additional information about signature files on the Manifest FormatUnderstanding Signing and Verification (1) page of the JDKTM documentation.

Understanding Signing and Verification (2024)
Top Articles
Encryption Passwords
What Do Clients Want from Financial Advisors?
Avonlea Havanese
Angela Babicz Leak
Koordinaten w43/b14 mit Umrechner in alle Koordinatensysteme
Brgeneral Patient Portal
Horoscopes and Astrology by Yasmin Boland - Yahoo Lifestyle
Prices Way Too High Crossword Clue
Gt Transfer Equivalency
065106619
Costco Gas Foster City
Tnt Forum Activeboard
Violent Night Showtimes Near Amc Fashion Valley 18
Nearest Walgreens Or Cvs Near Me
Unionjobsclearinghouse
Ups Drop Off Newton Ks
Slim Thug’s Wealth and Wellness: A Journey Beyond Music
Hood County Buy Sell And Trade
What Are The Symptoms Of A Bad Solenoid Pack E4od?
Jcp Meevo Com
D2L Brightspace Clc
Belledelphine Telegram
Star Wars Armada Wikia
Pipa Mountain Hot Pot渝味晓宇重庆老火锅 Menu
Nurtsug
Calculator Souo
NIST Special Publication (SP) 800-37 Rev. 2 (Withdrawn), Risk Management Framework for Information Systems and Organizations: A System Life Cycle Approach for Security and Privacy
About Us | SEIL
Skip The Games Ventura
Cross-Border Share Swaps Made Easier Through Amendments to India’s Foreign Exchange Regulations - Transatlantic Law International
Rogers Centre is getting a $300M reno. Here's what the Blue Jays ballpark will look like | CBC News
Robeson County Mugshots 2022
Craigslist Mexicali Cars And Trucks - By Owner
511Pa
Mcalister's Deli Warrington Reviews
Saline Inmate Roster
Rush Copley Swim Lessons
Sour OG is a chill recreational strain -- just have healthy snacks nearby (cannabis review)
Craigslist Rooms For Rent In San Fernando Valley
Oklahoma City Farm & Garden Craigslist
The Pretty Kitty Tanglewood
3367164101
Race Deepwoken
Turok: Dinosaur Hunter
tampa bay farm & garden - by owner "horses" - craigslist
Bbwcumdreams
Craigslist Indpls Free
March 2023 Wincalendar
Tamilblasters.wu
Metra Union Pacific West Schedule
Sdn Dds
Room For Easels And Canvas Crossword Clue
Latest Posts
Article information

Author: Carlyn Walter

Last Updated:

Views: 6448

Rating: 5 / 5 (70 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Carlyn Walter

Birthday: 1996-01-03

Address: Suite 452 40815 Denyse Extensions, Sengermouth, OR 42374

Phone: +8501809515404

Job: Manufacturing Technician

Hobby: Table tennis, Archery, Vacation, Metal detecting, Yo-yoing, Crocheting, Creative writing

Introduction: My name is Carlyn Walter, I am a lively, glamorous, healthy, clean, powerful, calm, combative person who loves writing and wants to share my knowledge and understanding with you.