Package org.jvnet.hudson.crypto
Class RSAPublicKeyUtil
java.lang.Object
org.jvnet.hudson.crypto.RSAPublicKeyUtil
Utility code to work around horrible Java Crypto API.
- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
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
-
Constructor Details
-
RSAPublicKeyUtil
public RSAPublicKeyUtil()
-
-
Method Details
-
readPublicKey
Loads RSA public key by parsing the OpenSSH format that it uses in ~/.ssh/authorized_keys- Throws:
IllegalArgumentException
- If the input line doesn't follow the expected format.GeneralSecurityException
-
getFingerPrint
Gets RSA key fingerprint in the form of "f7:7a:42:76:79:e8:8a:1a:4a:32:0c:b3:f9:3b:53:d4"- Throws:
GeneralSecurityException
-
getEC2FingerPrint
Gets RSA key fingerprint in the form EC2 does, which is different from how OpenSSH does.- Throws:
GeneralSecurityException
-
encode
Encodes RSA/DSA public keys into the OpenSSH format.- Throws:
GeneralSecurityException
-