test/jdk/com/sun/crypto/provider/Cipher/RSA/TestOAEPParameterSpec.java
branchJDK-8145252-TLS13-branch
changeset 56542 56aaa6cb3693
parent 47216 71c04702a3d5
equal deleted inserted replaced
56541:92cbbfc996f3 56542:56aaa6cb3693
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 4923484
    26  * @bug 4923484 8146293
    27  * @summary test ASN.1 encoding generation/parsing for the OAEPParameters
    27  * @summary test ASN.1 encoding generation/parsing for the OAEPParameters
    28  * implementation in SunJCE provider.
    28  * implementation in SunJCE provider.
    29  * @author Valerie Peng
    29  * @author Valerie Peng
    30  */
    30  */
    31 import java.math.BigInteger;
    31 import java.math.BigInteger;
   123         byte[] p = { (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04 };
   123         byte[] p = { (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04 };
   124         status &= runTest("SHA-224", MGF1ParameterSpec.SHA224, p);
   124         status &= runTest("SHA-224", MGF1ParameterSpec.SHA224, p);
   125         status &= runTest("SHA-256", MGF1ParameterSpec.SHA256, p);
   125         status &= runTest("SHA-256", MGF1ParameterSpec.SHA256, p);
   126         status &= runTest("SHA-384", MGF1ParameterSpec.SHA384, p);
   126         status &= runTest("SHA-384", MGF1ParameterSpec.SHA384, p);
   127         status &= runTest("SHA-512", MGF1ParameterSpec.SHA512, p);
   127         status &= runTest("SHA-512", MGF1ParameterSpec.SHA512, p);
       
   128         status &= runTest("SHA-512/224", MGF1ParameterSpec.SHA512_224, p);
       
   129         status &= runTest("SHA-512/256", MGF1ParameterSpec.SHA512_256, p);
   128         status &= runTest("SHA", MGF1ParameterSpec.SHA1, new byte[0]);
   130         status &= runTest("SHA", MGF1ParameterSpec.SHA1, new byte[0]);
   129         status &= runTest("SHA-1", MGF1ParameterSpec.SHA1, new byte[0]);
   131         status &= runTest("SHA-1", MGF1ParameterSpec.SHA1, new byte[0]);
   130         status &= runTest("SHA1", MGF1ParameterSpec.SHA1, new byte[0]);
   132         status &= runTest("SHA1", MGF1ParameterSpec.SHA1, new byte[0]);
   131         if (status) {
   133         if (status) {
   132             System.out.println("Test Passed");
   134             System.out.println("Test Passed");