public class RSAPublicKeyUtil extends Object
Constructor and Description |
---|
RSAPublicKeyUtil() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
encode(PublicKey key)
Encodes RSA/DSA public keys into the OpenSSH format.
|
static String |
getEC2FingerPrint(Key publicKey)
Gets RSA key fingerprint in the form EC2 does, which is different from how OpenSSH does.
|
static String |
getFingerPrint(PublicKey key)
Gets RSA key fingerprint in the form of "f7:7a:42:76:79:e8:8a:1a:4a:32:0c:b3:f9:3b:53:d4"
|
static PublicKey |
readPublicKey(String keyLine)
Loads RSA public key by parsing the OpenSSH format that it uses in ~/.ssh/authorized_keys
|
public static PublicKey readPublicKey(String keyLine) throws GeneralSecurityException
IllegalArgumentException
- If the input line doesn't follow the expected format.GeneralSecurityException
public static String getFingerPrint(PublicKey key) throws GeneralSecurityException
GeneralSecurityException
public static String getEC2FingerPrint(Key publicKey) throws GeneralSecurityException
GeneralSecurityException
public static byte[] encode(PublicKey key) throws GeneralSecurityException
GeneralSecurityException
Copyright © 2019. All rights reserved.