Package com.trilead.ssh2.signature
Class ECDSAKeyAlgorithm
- java.lang.Object
-
- com.trilead.ssh2.signature.KeyAlgorithm<java.security.interfaces.ECPublicKey,java.security.interfaces.ECPrivateKey>
-
- com.trilead.ssh2.signature.ECDSAKeyAlgorithm
-
- Direct Known Subclasses:
ECDSAKeyAlgorithm.ECDSASha2Nistp256
,ECDSAKeyAlgorithm.ECDSASha2Nistp384
,ECDSAKeyAlgorithm.ECDSASha2Nistp521
public abstract class ECDSAKeyAlgorithm extends KeyAlgorithm<java.security.interfaces.ECPublicKey,java.security.interfaces.ECPrivateKey>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ECDSAKeyAlgorithm.EcdsaCertificateDecoder
static class
ECDSAKeyAlgorithm.ECDSASha2Nistp256
static class
ECDSAKeyAlgorithm.ECDSASha2Nistp384
static class
ECDSAKeyAlgorithm.ECDSASha2Nistp521
private static class
ECDSAKeyAlgorithm.OpenSshEcdsaCertificateDecoder
-
Field Summary
Fields Modifier and Type Field Description private static byte
ANS1_INTEGER
private static byte
ANS1_ZERO
private java.lang.String
curveName
private static java.lang.String
ECDSA_SHA2_PREFIX
private java.security.spec.ECParameterSpec
ecParameterSpec
-
Constructor Summary
Constructors Modifier Constructor Description private
ECDSAKeyAlgorithm(java.lang.String signatureAlgorithm, java.lang.String curveName, java.security.spec.ECParameterSpec ecParameterSpec)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.security.spec.ECPoint
decodePoint(byte[] encodedPoint, java.security.spec.EllipticCurve curve)
java.security.interfaces.ECPublicKey
decodePublicKey(byte[] key)
byte[]
decodeSignature(byte[] encodedSignature)
private static byte[]
encodePoint(java.security.spec.ECPoint group, java.security.spec.EllipticCurve curve)
byte[]
encodePublicKey(java.security.interfaces.ECPublicKey key)
byte[]
encodeSignature(byte[] sig)
(package private) java.lang.String
getCurveName()
(package private) java.security.spec.ECParameterSpec
getEcParameterSpec()
private static byte[]
removeLeadingZeroes(byte[] input)
boolean
supportsKey(java.security.PrivateKey originalKey)
private static void
writeLength(int length, java.io.OutputStream os)
-
Methods inherited from class com.trilead.ssh2.signature.KeyAlgorithm
generateSignature, getCertificateDecoders, getKeyFormat, verifySignature
-
-
-
-
Field Detail
-
ECDSA_SHA2_PREFIX
private static final java.lang.String ECDSA_SHA2_PREFIX
- See Also:
- Constant Field Values
-
ANS1_INTEGER
private static final byte ANS1_INTEGER
- See Also:
- Constant Field Values
-
ANS1_ZERO
private static final byte ANS1_ZERO
- See Also:
- Constant Field Values
-
curveName
private final java.lang.String curveName
-
ecParameterSpec
private final java.security.spec.ECParameterSpec ecParameterSpec
-
-
Method Detail
-
getCurveName
java.lang.String getCurveName()
-
getEcParameterSpec
java.security.spec.ECParameterSpec getEcParameterSpec()
-
decodePublicKey
public java.security.interfaces.ECPublicKey decodePublicKey(byte[] key) throws java.io.IOException
- Specified by:
decodePublicKey
in classKeyAlgorithm<java.security.interfaces.ECPublicKey,java.security.interfaces.ECPrivateKey>
- Throws:
java.io.IOException
-
encodePublicKey
public byte[] encodePublicKey(java.security.interfaces.ECPublicKey key) throws java.io.IOException
- Specified by:
encodePublicKey
in classKeyAlgorithm<java.security.interfaces.ECPublicKey,java.security.interfaces.ECPrivateKey>
- Throws:
java.io.IOException
-
decodeSignature
public byte[] decodeSignature(byte[] encodedSignature) throws java.io.IOException
- Specified by:
decodeSignature
in classKeyAlgorithm<java.security.interfaces.ECPublicKey,java.security.interfaces.ECPrivateKey>
- Throws:
java.io.IOException
-
writeLength
private static void writeLength(int length, java.io.OutputStream os) throws java.io.IOException
- Throws:
java.io.IOException
-
encodeSignature
public byte[] encodeSignature(byte[] sig) throws java.io.IOException
- Specified by:
encodeSignature
in classKeyAlgorithm<java.security.interfaces.ECPublicKey,java.security.interfaces.ECPrivateKey>
- Throws:
java.io.IOException
-
supportsKey
public boolean supportsKey(java.security.PrivateKey originalKey)
- Overrides:
supportsKey
in classKeyAlgorithm<java.security.interfaces.ECPublicKey,java.security.interfaces.ECPrivateKey>
-
decodePoint
private static java.security.spec.ECPoint decodePoint(byte[] encodedPoint, java.security.spec.EllipticCurve curve)
-
encodePoint
private static byte[] encodePoint(java.security.spec.ECPoint group, java.security.spec.EllipticCurve curve)
-
removeLeadingZeroes
private static byte[] removeLeadingZeroes(byte[] input)
-
-