MCPcopy Index your code
hub / github.com/ZTFtrue/My-note / getPrivateKey

Method getPrivateKey

android/RSAUtil.java:56–61  ·  view source on GitHub ↗

获取私钥 @param privateKey 私钥字符串 @return

(String privateKey)

Source from the content-addressed store, hash-verified

54 * @return
55 */
56 public static PrivateKey getPrivateKey(String privateKey) throws Exception {
57 KeyFactory keyFactory = KeyFactory.getInstance("RSA");
58 byte[] decodedKey = Base64.decode(privateKey.getBytes(),Base64.NO_WRAP);
59 PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(decodedKey);
60 return keyFactory.generatePrivate(keySpec);
61 }
62
63
64 /**

Callers 1

decryptMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected