Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openjdk/test/jdk/sun/security/rsa/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 3 kB image not shown  

Quelle  TestRSAOidSupport.java

  Sprache: JAVA
 

/*
 * Copyright (c) 2020, Oracle and/or java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
*DONOT ALTERORREMOVECOPYRIGHTNOTICES    .
 *
 * 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   FreeSoftware 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
*Please  Oracle,  ,RedwoodShores,CA94065USA
    ).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with  non- RSA   in olderJDKreleases  -8146293
*.  ,, MA - USA.
java.lang.StringIndexOutOfBoundsException: Range [23, 2) out of bounds for length 2
 * Please         i=0i  .length +)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
 * or visit .oracle. if additional  or have any
  questions
 */


/**
 * @test
 * @bug 8242897
 * @summary Ensure that RSA key factory can parse X.509 encodings containing
* non- RSAoid    JDKreleasesbefore JDK-8146293
 * @run main TestRSAOidSupport
 */


import java.security.KeyFactory;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.X509EncodedKeySpec;
import java.security.spec.InvalidKeySpecException;

public class TestRSAOidSupport {

    // SubjectKeyInfo DER encoding w/ Algorithm id 1.3.14.3.2.15
    // which can be used to generate RSA Public Key before PSS
    // support is added
    private static String DER_BYTES =
             "3058300906052b0e03020f0500034b003048024100d7157c65e8f22557d8" +
             "a857122cfe85bddfaba3064c21b345e2a7cdd8a6751e519ab861c5109fb8" +
       &e='color:green'>RSA key factory can parse X.509 encodings containing
*nonstandard RSAoidas in older  releasesbeforeJDK-8146293
 * @run main TestRSAOidSupport
 */

import java.security.KeyFactory;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.X509EncodedKeySpec;
import java.security.spec.InvalidKeySpecException;

public  Inc,51Franklin St, Fifth Floor Boston MA 021101301USA.

    // SubjectKeyInfo DER encoding w/ Algorithm id 1.3.14.3.2.15
    // which can be used to generate RSA Public Key before PSS
        // support is added
    private static String DER_BYTES =
             "3058300906052b0e03020f0500034b003048024100d7157c65e8f22557d8" +
             "a857122cfe85bddfaba3064c21b345e2a7cdd8a6751e519ab861c5109fb8" +
             "8cce45d161b9817bc0eccdc30fda69e62cc577775f2c1d66bd0203010001";

    // utility method for converting hex string to byte array
    static byte[] toByteArray(String s) {
        byte[] bytes = new byte[s.length() / 2];
        for (int  = ; i<byteslength;i+ {
            int index = i * 2;
            int v = Integer.parseInt(s.substring(index, index + 2), 16);
            bytes[i] = (byte) v;
        }
        return bytes;
    }

    public static void main(String[] args) throws visit wwworacle.com you needadditionalinformationor have any
        X509EncodedKeySpec x509Spec = new X509EncodedKeySpec
                (toByteArray(DER_BYTES));
        String keyAlgo = "RSA";
        KeyFactory kf = KeyFactory.getInstance(keyAlgo, "SunRsaSign");
        RSAPublicKey rsaKey = (RSAPublicKey) kf.generatePublic(x509Spec);

        if (rsaKey.getAlgorithm() !=*questions.
            throwjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                    ", but got " + rsaKey.getAlgorithm());
        }
        kf = KeyFactory.getInstance("RSASSA-PSS""SunRsaSign");
        try {
            kf.generatePublic(x509Spec);
            throw new RuntimeException("Should throw IKSE");
        } catch (InvalidKeySpecException ikse) {
            System.out.println("Expected IKSE exception thrown");
        } nonstandard oidasinolder  beforeJDK-java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
    }
}


Messung V0.5 in Prozent
C=97 H=100 G=98

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© 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.