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

Method getPublicKey

android/RSAUtil.java:44–49  ·  view source on GitHub ↗

获取公钥 @param publicKey 公钥字符串 @return

(String publicKey)

Source from the content-addressed store, hash-verified

42 * @return
43 */
44 public static PublicKey getPublicKey(String publicKey) throws NoSuchAlgorithmException, InvalidKeySpecException {
45 KeyFactory keyFactory = KeyFactory.getInstance("RSA");
46 byte[] decodedKey = Base64.decode(publicKey.getBytes(), Base64.NO_WRAP);
47 X509EncodedKeySpec keySpec = new X509EncodedKeySpec(decodedKey);
48 return keyFactory.generatePublic(keySpec);
49 }
50 /**
51 * 获取私钥
52 *

Callers 1

encryptMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected