update:公钥,私钥修改
This commit is contained in:
parent
0828d5aa0c
commit
175d1e365a
|
@ -10,7 +10,8 @@ import java.util.Base64;
|
|||
|
||||
public class RSAUtil {
|
||||
|
||||
private static String key = "kingdee20241219";
|
||||
private static String publicKeyString = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1XBGWkKD5/qmnaPJ8OWbypW8RIf8UPQIgTEVBaWNF4m5KwmtU9gO201s7aAJE2gW8tcpzjl+KtQUkxog1TnF5AmYDLXqgJb4N8vWGU5Vf+jJGzyzT2U7loDTGtgumzJJB3ySapAyPCGW3tyFMTZOEc+iVrCw2iOjzYUim0SKtzB4/3prJpEDfnjwM9BJYeG/2w9i+t5ZiSRLaCvSK2tm/4JflcKjommW/ImeD67wikCbnAD5HUAG9hLXL9ApW/1Z83YM83EfoFOQJNoSZ7NvSBTEuIzhoQCZHS0F/n1tSktAJvYLL2M5yG7/EdAb/zw8/ox63d+mvbDK/4sczst0AQIDAQAB";
|
||||
private static String privateKeyString = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDVcEZaQoPn+qado8nw5ZvKlbxEh/xQ9AiBMRUFpY0XibkrCa1T2A7bTWztoAkTaBby1ynOOX4q1BSTGiDVOcXkCZgMteqAlvg3y9YZTlV/6MkbPLNPZTuWgNMa2C6bMkkHfJJqkDI8IZbe3IUxNk4Rz6JWsLDaI6PNhSKbRIq3MHj/emsmkQN+ePAz0Elh4b/bD2L63lmJJEtoK9Ira2b/gl+VwqOiaZb8iZ4PrvCKQJucAPkdQAb2Etcv0Clb/VnzdgzzcR+gU5Ak2hJns29IFMS4jOGhAJkdLQX+fW1KS0Am9gsvYznIbv8R0Bv/PDz+jHrd36a9sMr/ixzOy3QBAgMBAAECggEAXOVc+XPxzUm+suXSwtJsmCPLqVg2bVWJThF6wNZpLlF3ElBH7DIhZTmxq0r4KEYpltAnFebYDvP3cH7yw1s90h6K2x1iT01mA4LoUGNTuzQqM3yb3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gJZUFmvTthY6SvkYrqg1H";
|
||||
|
||||
/**
|
||||
* 加密
|
||||
|
@ -50,7 +51,7 @@ public class RSAUtil {
|
|||
* @throws Exception 异常
|
||||
*/
|
||||
public static PublicKey getPublicKeyFromString() throws Exception {
|
||||
byte[] keyBytes = Base64.getDecoder().decode(key);
|
||||
byte[] keyBytes = Base64.getDecoder().decode(publicKeyString);
|
||||
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
|
||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||
return keyFactory.generatePublic(keySpec);
|
||||
|
@ -63,7 +64,7 @@ public class RSAUtil {
|
|||
* @throws Exception 异常
|
||||
*/
|
||||
public static PrivateKey getPrivateKeyFromString() throws Exception {
|
||||
byte[] keyBytes = Base64.getDecoder().decode(key);
|
||||
byte[] keyBytes = Base64.getDecoder().decode(privateKeyString);
|
||||
PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes);
|
||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||
return keyFactory.generatePrivate(keySpec);
|
||||
|
|
Loading…
Reference in New Issue