/* * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
/* * @test * @bug 8076190 8242151 8153005 8266293 * @library /test/lib * @modules java.base/sun.security.pkcs * java.base/sun.security.util * @summary Checks the preferences order of pkcs12 params, whether it's * a system property or a security property, whether the name has * "pkcs12" or "PKCS12", whether the legacy property is set.
*/ publicclass ParamsPreferences {
publicstaticfinalvoid main(String[] args) throws Exception { int c = 0;
// back to with storepass by overriding security property with system property
test(c++,
Map.of("keystore.pkcs12.certProtectionAlgorithm", "PBEWithSHA1AndDESede", "keystore.pkcs12.macAlgorithm", "HmacPBESHA256"),
Map.of("keystore.pkcs12.certProtectionAlgorithm", "NONE", "keystore.pkcs12.macAlgorithm", "NONE"),
PBEWithSHA1AndDESede, 10000,
PBES2, HmacSHA256, AES_256$CBC$NoPadding, 10000,
SHA_256, 10000);
// back to with storepass by using "" to force hardcoded default
test(c++,
Map.of("keystore.pkcs12.certProtectionAlgorithm", "", "keystore.pkcs12.keyProtectionAlgorithm", "", "keystore.pkcs12.macAlgorithm", ""),
Map.of("keystore.pkcs12.certProtectionAlgorithm", "NONE", "keystore.pkcs12.keyProtectionAlgorithm", "PBEWithSHA1AndRC2_40", "keystore.pkcs12.macAlgorithm", "NONE"),
PBES2, HmacSHA256, AES_256$CBC$NoPadding, 10000,
PBES2, HmacSHA256, AES_256$CBC$NoPadding, 10000,
SHA_256, 10000);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.