MCPcopy Create free account
hub / github.com/SEBV1/idlefish_monitor / sign

Method sign

src/main/java/com/github/utils/Rsa.java:62–73  ·  view source on GitHub ↗
(String str, String str2)

Source from the content-addressed store, hash-verified

60 }
61
62 public static String sign(String str, String str2) {
63 try {
64 PrivateKey generatePrivate = KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(Base64.decode(str2)));
65 Signature signature = Signature.getInstance("SHA1WithRSA");
66 signature.initSign(generatePrivate);
67 signature.update(str.getBytes("utf-8"));
68 return Base64.encode(signature.sign());
69 } catch (Exception e) {
70 e.printStackTrace();
71 return null;
72 }
73 }
74
75 public static void main(String[] args) {
76 String encrypt = Rsa.encrypt("123456");

Callers

nothing calls this directly

Calls 4

decodeMethod · 0.95
encodeMethod · 0.95
getInstanceMethod · 0.80
updateMethod · 0.80

Tested by

no test coverage detected