src/java.base/share/classes/java/util/jar/Manifest.java
changeset 52171 0da586f1ed05
parent 52159 42244a052fbb
child 53095 33a51275fee0
child 53291 8f822a19309b
equal deleted inserted replaced
52170:2990f1e1c325 52171:0da586f1ed05
   167      * @throws SecurityException if the associated jar is signed but this entry
   167      * @throws SecurityException if the associated jar is signed but this entry
   168      *      has been modified after signing (i.e. the section in the manifest
   168      *      has been modified after signing (i.e. the section in the manifest
   169      *      does not exist in SF files of all signers).
   169      *      does not exist in SF files of all signers).
   170      */
   170      */
   171     Attributes getTrustedAttributes(String name) {
   171     Attributes getTrustedAttributes(String name) {
       
   172         // Note: Before the verification of MANIFEST.MF/.SF/.RSA files is done,
       
   173         // jv.isTrustedManifestEntry() isn't able to detect MANIFEST.MF change.
       
   174         // Users of this method should call SharedSecrets.javaUtilJarAccess()
       
   175         // .ensureInitialization() first.
   172         Attributes result = getAttributes(name);
   176         Attributes result = getAttributes(name);
   173         if (result != null && jv != null && ! jv.isTrustedManifestEntry(name)) {
   177         if (result != null && jv != null && ! jv.isTrustedManifestEntry(name)) {
   174             throw new SecurityException("Untrusted manifest entry: " + name);
   178             throw new SecurityException("Untrusted manifest entry: " + name);
   175         }
   179         }
   176         return result;
   180         return result;