Package org.jclouds.digitalocean2.ssh
Class ECDSAKeys
- java.lang.Object
-
- org.jclouds.digitalocean2.ssh.ECDSAKeys
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ECDSAKeys.EllipticCurves
-
Field Summary
Fields Modifier and Type Field Description static String
ECDSA_SHA2_PREFIX
-
Constructor Summary
Constructors Constructor Description ECDSAKeys()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ECPoint
decodeECPoint(byte[] M, EllipticCurve curve)
Decode an OctetString to EllipticCurvePoint according to SECG 2.3.4static String
encodeAsOpenSSH(ECPublicKey key)
static byte[]
encodeECPoint(ECPoint group, EllipticCurve curve)
Encode EllipticCurvePoint to an OctetStringstatic String
fingerprint(ECPublicKey publicKey)
Create a fingerprint per the following specstatic String
fingerprintPublicKey(String publicKeyOpenSSH)
static ECPublicKeySpec
publicKeySpecFromOpenSSH(com.google.common.io.ByteSource supplier)
ReturnsDSAPublicKeySpec
which was OpenSSH Base64 Encodedid_rsa.pub
static ECPublicKeySpec
publicKeySpecFromOpenSSH(String ecDsaPub)
Executesorg.jclouds.crypto.Pems#publicKeySpecFromOpenSSH(com.google.common.io.InputSupplier)
on the string which was OpenSSH Base64 Encodedid_rsa.pub
-
-
-
Field Detail
-
ECDSA_SHA2_PREFIX
public static final String ECDSA_SHA2_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
encodeAsOpenSSH
public static String encodeAsOpenSSH(ECPublicKey key)
-
publicKeySpecFromOpenSSH
public static ECPublicKeySpec publicKeySpecFromOpenSSH(String ecDsaPub)
Executesorg.jclouds.crypto.Pems#publicKeySpecFromOpenSSH(com.google.common.io.InputSupplier)
on the string which was OpenSSH Base64 Encodedid_rsa.pub
- Parameters:
idRsaPub
- formattedssh-dss AAAAB3NzaC1yc2EAAAADAQABAAAB...
- See Also:
org.jclouds.crypto.Pems#publicKeySpecFromOpenSSH(com.google.common.io.InputSupplier)
-
publicKeySpecFromOpenSSH
public static ECPublicKeySpec publicKeySpecFromOpenSSH(com.google.common.io.ByteSource supplier) throws IOException
ReturnsDSAPublicKeySpec
which was OpenSSH Base64 Encodedid_rsa.pub
- Parameters:
supplier
- the input stream factory, formattedssh-dss AAAAB3NzaC1yc2EAAAADAQABAAAB...
- Returns:
- the
DSAPublicKeySpec
which was OpenSSH Base64 Encodedid_rsa.pub
- Throws:
IOException
- if an I/O error occurs
-
fingerprintPublicKey
public static String fingerprintPublicKey(String publicKeyOpenSSH) throws IOException
- Parameters:
publicKeyOpenSSH
- RSA public key in OpenSSH format- Returns:
- fingerprint ex.
2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9
- Throws:
IOException
-
fingerprint
public static String fingerprint(ECPublicKey publicKey)
Create a fingerprint per the following spec- Returns:
- hex fingerprint ex.
2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9
-
encodeECPoint
public static byte[] encodeECPoint(ECPoint group, EllipticCurve curve)
Encode EllipticCurvePoint to an OctetString
-
decodeECPoint
public static ECPoint decodeECPoint(byte[] M, EllipticCurve curve)
Decode an OctetString to EllipticCurvePoint according to SECG 2.3.4
-
-