/** * Create a fingerprint per the following <a * href="http://tools.ietf.org/html/draft-friedl-secsh-fingerprint-00" >spec</a> * * @param publicExponent * @param modulus * * @return hex fingerprint ex. {@code 2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9} */ public static String fingerprint(BigInteger publicExponent, BigInteger modulus) { byte[] keyBlob = keyBlob(publicExponent, modulus); return hexColonDelimited(Hashing.md5().hashBytes(keyBlob)); }
/** * Create a fingerprint per the following <a * href="http://tools.ietf.org/html/draft-friedl-secsh-fingerprint-00" >spec</a> * * @param publicExponent * @param modulus * * @return hex fingerprint ex. {@code 2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9} */ public static String fingerprint(BigInteger publicExponent, BigInteger modulus) { byte[] keyBlob = keyBlob(publicExponent, modulus); return hexColonDelimited(Hashing.md5().hashBytes(keyBlob)); }
/** * Create a fingerprint per the following <a * href="http://tools.ietf.org/html/draft-friedl-secsh-fingerprint-00" >spec</a> * * @param publicExponent * @param modulus * * @return hex fingerprint ex. {@code 2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9} */ public static String fingerprint(BigInteger publicExponent, BigInteger modulus) { byte[] keyBlob = keyBlob(publicExponent, modulus); return hexColonDelimited(Hashing.md5().hashBytes(keyBlob)); }
/** * Create a fingerprint per the following <a * href="http://tools.ietf.org/html/draft-friedl-secsh-fingerprint-00" >spec</a> * * @param publicExponent * @param modulus * * @return hex fingerprint ex. {@code 2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9} */ public static String fingerprint(BigInteger publicExponent, BigInteger modulus) { byte[] keyBlob = keyBlob(publicExponent, modulus); return hexColonDelimited(Hashing.md5().hashBytes(keyBlob)); }
/** * Create a SHA-1 digest of the DER encoded private key. * * @param publicExponent * @param modulus * * @return hex sha1HexColonDelimited ex. {@code 2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9} */ public static String sha1(RSAPrivateCrtKeySpec privateKey) { try { byte[] encodedKey = KeyFactory.getInstance("RSA").generatePrivate(privateKey).getEncoded(); return hexColonDelimited(Hashing.sha1().hashBytes(encodedKey)); } catch (InvalidKeySpecException e) { throw propagate(e); } catch (NoSuchAlgorithmException e) { throw propagate(e); } }
/** * Create a SHA-1 digest of the DER encoded private key. * * @param publicExponent * @param modulus * * @return hex sha1HexColonDelimited ex. {@code 2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9} */ public static String sha1(RSAPrivateCrtKeySpec privateKey) { try { byte[] encodedKey = KeyFactory.getInstance("RSA").generatePrivate(privateKey).getEncoded(); return hexColonDelimited(Hashing.sha1().hashBytes(encodedKey)); } catch (InvalidKeySpecException e) { throw propagate(e); } catch (NoSuchAlgorithmException e) { throw propagate(e); } }
/** * Create a SHA-1 digest of the DER encoded private key. * * @param publicExponent * @param modulus * * @return hex sha1HexColonDelimited ex. {@code 2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9} */ public static String sha1(RSAPrivateCrtKeySpec privateKey) { try { byte[] encodedKey = KeyFactory.getInstance("RSA").generatePrivate(privateKey).getEncoded(); return hexColonDelimited(Hashing.sha1().hashBytes(encodedKey)); } catch (InvalidKeySpecException e) { throw propagate(e); } catch (NoSuchAlgorithmException e) { throw propagate(e); } }
/** * Create a SHA-1 digest of the DER encoded private key. * * @param publicExponent * @param modulus * * @return hex sha1HexColonDelimited ex. {@code 2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9} */ public static String sha1(RSAPrivateCrtKeySpec privateKey) { try { byte[] encodedKey = KeyFactory.getInstance("RSA").generatePrivate(privateKey).getEncoded(); return hexColonDelimited(Hashing.sha1().hashBytes(encodedKey)); } catch (InvalidKeySpecException e) { throw propagate(e); } catch (NoSuchAlgorithmException e) { throw propagate(e); } }