@Test public void testGetRsaPublicKeyFingerprint() throws NoSuchAlgorithmException { assertEquals("Key fingerprint invalid", "000317457b5645b7b5c4daf4cf6780c05438effd", KeyUtils.getRsaPublicKeyFingerprint((RSAPublicKey) masterKey .getPublic(), provider)); }
public static String getRsaPublicKeyFingerprint(RSAPublicKey pubKey, Provider provider) throws NoSuchAlgorithmException { byte[] pubkeyEnc = derEncodeRSAPublicKey(pubKey); MessageDigest sha1; if(provider != null) { sha1 = MessageDigest.getInstance("sha1", provider); } else { sha1 = MessageDigest.getInstance("sha1"); } byte[] pubkeyDigest = sha1.digest(pubkeyEnc); return toHexPadded(pubkeyDigest); }
KeyUtils { public static String getRsaPublicKeyFingerprint(RSAPublicKey pubKey, Provider provider) throws NoSuchAlgorithmException { byte[] pubkeyEnc = derEncodeRSAPublicKey(pubKey); MessageDigest sha1; if(provider != null) { sha1 = MessageDigest.getInstance("sha1", provider); } else { sha1 = MessageDigest.getInstance("sha1"); } byte[] pubkeyDigest = sha1.digest(pubkeyEnc); return toHexPadded(pubkeyDigest); } }
KeyUtils { public static String getRsaPublicKeyFingerprint(RSAPublicKey pubKey, Provider provider) throws NoSuchAlgorithmException { byte[] pubkeyEnc = derEncodeRSAPublicKey(pubKey); MessageDigest sha1; if(provider != null) { sha1 = MessageDigest.getInstance("sha1", provider); } else { sha1 = MessageDigest.getInstance("sha1"); } byte[] pubkeyDigest = sha1.digest(pubkeyEnc); return toHexPadded(pubkeyDigest); }  }
KeyUtils { public static String getRsaPublicKeyFingerprint(RSAPublicKey pubKey, Provider provider) throws NoSuchAlgorithmException { byte[] pubkeyEnc = derEncodeRSAPublicKey(pubKey); MessageDigest sha1; if(provider != null) { sha1 = MessageDigest.getInstance("sha1", provider); } else { sha1 = MessageDigest.getInstance("sha1"); } byte[] pubkeyDigest = sha1.digest(pubkeyEnc); return toHexPadded(pubkeyDigest); }  static String getRsaPublicKeyFingerprint(RSAPublicKey pubKey, Provider provider); static String toHexPadded(byte[] data); static byte[] derEncodeBigInteger(BigInteger value); static byte[] derEncodeValue(byte type, byte[] bytes); static byte[] derEncodeRSAPublicKey(RSAPublicKey pubkey); static byte[] derEncodeSequence(List<byte[]> objects); static KeyPair rsaKeyPairFromBase64(String publicKey, String privateKey); static SecretKey decryptKey(String encodedKey, String algorithm, Provider provider, PrivateKey privateKey); static String encryptKey(SecretKey key, Provider provider, PublicKey publicKey); static String urlSafeEncodeBase64(byte[] data); static byte[] urlSafeDecodeBase64(String b64Data); static String signMetadata(Map<String, String> metadata,
            RSAPrivateKey privateKey, Provider provider); static byte[] extractSubjectKeyIdentifier(byte[] derSki); }
KeyUtils { public static String getRsaPublicKeyFingerprint(RSAPublicKey pubKey, Provider provider) throws NoSuchAlgorithmException { byte[] pubkeyEnc = derEncodeRSAPublicKey(pubKey); MessageDigest sha1; if(provider != null) { sha1 = MessageDigest.getInstance("sha1", provider); } else { sha1 = MessageDigest.getInstance("sha1"); } byte[] pubkeyDigest = sha1.digest(pubkeyEnc); return toHexPadded(pubkeyDigest); }  static String getRsaPublicKeyFingerprint(RSAPublicKey pubKey, Provider provider); static String toHexPadded(byte[] data); static byte[] derEncodeBigInteger(BigInteger value); static byte[] derEncodeValue(byte type, byte[] bytes); static byte[] derEncodeRSAPublicKey(RSAPublicKey pubkey); static byte[] derEncodeSequence(List<byte[]> objects); static KeyPair rsaKeyPairFromBase64(String publicKey, String privateKey); static SecretKey decryptKey(String encodedKey, String algorithm, Provider provider, PrivateKey privateKey); static String encryptKey(SecretKey key, Provider provider, PublicKey publicKey); static String urlSafeEncodeBase64(byte[] data); static byte[] urlSafeDecodeBase64(String b64Data); static String signMetadata(Map<String, String> metadata,
            RSAPrivateKey privateKey, Provider provider); static byte[] extractSubjectKeyIdentifier(byte[] derSki);  }