8278349: JarSigner javadoc example uses SHA-1

Reviewed-by: weijun
This commit is contained in:
Eirik Bjorsnos 2023-01-13 17:55:07 +00:00 committed by Weijun Wang
parent d117979503
commit 4ec3659845

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -76,16 +76,16 @@ import java.util.zip.ZipOutputStream;
* a {@link NullPointerException}. * a {@link NullPointerException}.
* <p> * <p>
* Example: * Example:
* <pre> * {@snippet lang="java" :
* JarSigner signer = new JarSigner.Builder(key, certPath) * JarSigner signer = new JarSigner.Builder(key, certPath)
* .digestAlgorithm("SHA-1") * .digestAlgorithm("SHA-256")
* .signatureAlgorithm("SHA1withDSA") * .signatureAlgorithm("SHA256withRSA")
* .build(); * .build();
* try (ZipFile in = new ZipFile(inputFile); * try (ZipFile in = new ZipFile(inputFile);
* FileOutputStream out = new FileOutputStream(outputFile)) { * FileOutputStream out = new FileOutputStream(outputFile)) {
* signer.sign(in, out); * signer.sign(in, out);
* }
* } * }
* </pre>
* *
* @since 9 * @since 9
*/ */