10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 8029849
27 * @summary Make sure signing via encrypt and verifying via decrypt are not
28 * supported by OracleUcrypto provider.
29 * @author Anthony Scarpino
30 */
31
32 import java.util.Random;
33 import java.security.KeyPairGenerator;
34 import java.security.KeyPair;
35 import javax.crypto.Cipher;
36 import java.security.InvalidKeyException;
37 import java.security.NoSuchAlgorithmException;
38 import java.security.Provider;
39
40 public class CipherSignNotSupported extends UcryptoTest {
41
42 public static void main(String[] args) throws Exception {
43 main(new CipherSignNotSupported(), null);
44 }
45
46 public void doTest(Provider p) throws Exception {
47 Cipher c = null;
48 Random random = new Random();
49 byte[] pt = new byte[117];
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 8029849
27 * @summary Make sure signing via encrypt and verifying via decrypt are not
28 * supported by OracleUcrypto provider.
29 * @author Anthony Scarpino
30 * @key randomness
31 */
32
33 import java.util.Random;
34 import java.security.KeyPairGenerator;
35 import java.security.KeyPair;
36 import javax.crypto.Cipher;
37 import java.security.InvalidKeyException;
38 import java.security.NoSuchAlgorithmException;
39 import java.security.Provider;
40
41 public class CipherSignNotSupported extends UcryptoTest {
42
43 public static void main(String[] args) throws Exception {
44 main(new CipherSignNotSupported(), null);
45 }
46
47 public void doTest(Provider p) throws Exception {
48 Cipher c = null;
49 Random random = new Random();
50 byte[] pt = new byte[117];
|