From 09641808f918fc4529552be7bf6ccae288b409d7 Mon Sep 17 00:00:00 2001 From: 64586190168b7e02f64e79c2 <64586190168b7e02f64e79c2@devide> Date: Wed, 10 May 2023 02:19:58 +0000 Subject: [PATCH] Auto commit --- Main.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Main.java b/Main.java index dc2600c..1f9886c 100644 --- a/Main.java +++ b/Main.java @@ -72,7 +72,7 @@ public class Main { rsa = new RSA(sc.nextBigInteger(),sc.nextBigInteger(),sc.nextBigInteger()); } case 2->{ - print.println("输入密钥长度"); + print.println("输入密钥长度,长度不小于512"); rsa = new RSA(sc.nextInt()); } } @@ -167,6 +167,9 @@ class RSA { * @param keySize 密钥大小 */ public RSA(int keySize){ + if(keySize < 512){ + System.err.println("都说了不要小于512,会报错的,重新启动程序吧"); + } try { KeyPairGenerator keyGenerator = KeyPairGenerator.getInstance("RSA"); keyGenerator.initialize(keySize); -- GitLab