Skip to content

Commit 4ec3659

Browse files
eirbjowangweij
authored andcommitted
8278349: JarSigner javadoc example uses SHA-1
Reviewed-by: weijun
1 parent d117979 commit 4ec3659

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -76,16 +76,16 @@
7676
* a {@link NullPointerException}.
7777
* <p>
7878
* Example:
79-
* <pre>
80-
* JarSigner signer = new JarSigner.Builder(key, certPath)
81-
* .digestAlgorithm("SHA-1")
82-
* .signatureAlgorithm("SHA1withDSA")
83-
* .build();
84-
* try (ZipFile in = new ZipFile(inputFile);
85-
* FileOutputStream out = new FileOutputStream(outputFile)) {
86-
* signer.sign(in, out);
79+
* {@snippet lang="java" :
80+
* JarSigner signer = new JarSigner.Builder(key, certPath)
81+
* .digestAlgorithm("SHA-256")
82+
* .signatureAlgorithm("SHA256withRSA")
83+
* .build();
84+
* try (ZipFile in = new ZipFile(inputFile);
85+
* FileOutputStream out = new FileOutputStream(outputFile)) {
86+
* signer.sign(in, out);
87+
* }
8788
* }
88-
* </pre>
8989
*
9090
* @since 9
9191
*/

0 commit comments

Comments
 (0)