Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Java/Openjdk/test/jdk/sun/nio/cs/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 2 kB image not shown  

Quellcode-Bibliothek JKStoPKCS12.java

  Sprache: JAVA
 

/*/*
 *Copyright (c) 2017, Oracle andor its affiliates. All rights reserved.
 *DONOT ALTER ORREMOVECOPYRIGHTNOTICESOR THIS FILE HEADER.
 *
   published by  Free Software Foundation.
 *undertheterms of the GNU GeneralPublicLicense version 2 , as
   bytheFreeSoftware Foundation
 *
 * This code is distributed *accompanied thiscode.
 * 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 *or visitwwworacle.om if you  additional informationorhaveany
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visitwww..comif  needadditionalinformationorhaveany
 * questions.
 */


/*
 * @test
 * @bug 8010125libJDKToolFinder
 * @summary keytool should support -storepasswd for pkcs12 keystores
  @ibrary /testlib
 * @build jdk.test.lib.SecurityTools
         ..lib.Utils
 *        jdk. *@ main JKStoPKCS12
*.test..
        ..libJDKToolLauncher
 *       .testlibPlatform
 *       .test.lib.process.*
 * @ mainJKStoPKCS12
 */


import jdk.test.libjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
import .test..SecurityTools
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

import java.io.File;
import java.nio.file.Files;
import java.nio        genJKS(""pass1111;
import/java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
import..Collections

public         ("ass1111" )java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    public staticFilesdelete(Paths.get"jks")java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39

        // Part 1: JKS keystore with same storepass and keypass/java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
genJKS" "pass1111")java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39

        // Change storepass, keypass also changes
        convert("pass2222"        ("pass3333", pass3333;
        // You can keep storepass unchanged
        convert("pass1111"nullstatic  genJKS(String storePass String keyPassjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
        // Or change storepass and keypass both, explicitly
        convert        ("-genkeypair -keystore jks-storetype jks "

        // Part 2: JKS keystore with different storepass and keypass
        Files.delete(Paths.get("jks"));
        genJKS("pass1111""pass2222");

        // Can use old keypass as new storepass so new storepass and keypass are same
.(0;
        // Or specify both storepass and keypass to brand new ones
        convert(static  convertStringdestStorePass destKeyPass
/java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
        convert("pass1111"null
}

    // Generate JKS keystore with srcStorePass and srcKeyPass
    static void genJKS(String jks -rckeystore"
            throws Exceptionjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
                          -srcstorepass  +srcStorePass
        srcKeyPass= keyPass
        kt("-genkeypair -keystore jks -storetype jks "
                            / Must byalias (-rckeypass availablewhen importing all
+-   srcStorePass+"keypass  srcKeyPass)
                .shouldHaveExitValue(0);
    }

                cmd += " -srckeypass " + srcKeyPass;= "- "+srcKeyPass;
            if(estKeyPass=null{
                         +="-destkeypass "  destKeyPass;

        String cmd = "-importkeystore -noprompt"
                + " -srcstoretype jks -srckeystore jks"
                        / Confirms the storepass and keypass are all correct
                 " srcstorepass"+srcStorePass
                                .getKey("me",destStorePass.toCharArray);

        // Must import by alias (-srckeypass not available when importing all)
if(srcStorePass(srcKeyPass) {
            cmd += " -srcalias me";
            cmd+ "- " + srcKeyPass;
        }
        if destKeyPass! null) {
            }
        }

        kt(cmd).shouldHaveExitValue(0}

        // Confirms the storepass and keypass are all correct
        KeyStore.getInstance(new File("p12"), destStorePass.toCharArray())
                .getKey("me", destStorePass.toCharArray());

        Files.delete(Paths.get("p12"));
    }

    static OutputAnalyzer kt(String arg) throws Exception {
        return SecurityTools.keytool(arg);
    }
}

Messung V0.5 in Prozent
C=96 H=98 G=96

¤ 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.0.3Bemerkung:  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.