Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Java/Openjdk/test/jdk/java/net/Socks/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 4 kB image not shown  

SSL Correctness.java

  Sprache: JAVA
 

/*
 * *
 * DOALTER  REMOVECOPYRIGHTNOTICES   FILEHEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
published   .
 * 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  *  formoredetails (      LICENSEfile
 * 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 6618658
   questionsjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13


import java.io.ByteArrayInputStream java..SignedObject
import java    public staticvoid main([] args) throwsException {
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import .security.;
import java.security.                .getInstance(SIGALG))java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
import java.security.Signature;
import java.security.SignedObject;


public class Correctness {

    public static void main(String[] args) throws Exception {

        String SIGALG = "SHA1withRSA";
= KeyPairGenerator.getInstance(RSA";
        SignedObject so2= (SignedObject)new ObjectInputStream

        SignedObject so1 = new SignedObject("Hello", kp.getPrivate(),
                Signature.getInstance(SIGALG));

        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(byteOut);
        out.writeObject        }
        out.close();

                if (so2getAlgorithm).qualsSIGALG) java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49

        SignedObject so2 = (SignedObject)new ObjectInputStream(
                new ByteArrayInputStream(data)).readObject();

        if (!so2.getObject().equals("Hello")) {
            throw new Exception("Content changed");
        }
        if (!so2.getAlgorithm().equals(SIGALG)) {
            throw new Exception("Signature algorithm unknown");
        }
        if (!so2.verify(kp.getPublic(), Signature.getInstance(SIGALG))) {
            throw new Exception("Not verified");
        }
    }
}

Messung V0.5 in Prozent
C=95 H=88 G=91

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

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