com.mindbright.ssh2
public abstract class SSH2ECDSASHA2NIST extends SSH2SimpleSignature
Modifier and Type | Class and Description |
---|---|
static class |
SSH2ECDSASHA2NIST.P256 |
static class |
SSH2ECDSASHA2NIST.P384 |
static class |
SSH2ECDSASHA2NIST.P521 |
draftIncompatibleSignature, signatureAlgorithm, ssh2KeyFormat
algorithm, pubKeyBlob, publicKey, signature
Constructor and Description |
---|
SSH2ECDSASHA2NIST(java.lang.String algo,
java.lang.String sshname,
java.lang.String curve) |
Modifier and Type | Method and Description |
---|---|
protected java.security.PublicKey |
decodePublicKey(byte[] pubKeyBlob)
Decode a public key blob.
|
protected byte[] |
encodePublicKey(java.security.PublicKey publicKey)
Encode the given public key into a public key blob.
|
static java.security.spec.ECParameterSpec |
getParamsForCurve(java.lang.String curve) |
byte[] |
sign(byte[] data)
Sign the given data.
|
boolean |
verify(byte[] sigBlob,
byte[] data)
Verify that the given signature matches the given data and the
public key.
|
decodeSignature, encodeSignature, getKeyFormat, getSignatureAlgorithm, getVerifyInstance, setIncompatibility
clearSensitiveData, getAlgorithmName, getEncodingInstance, getInstance, getPublicKey, getPublicKeyBlob, initSign, initVerify, initVerify, setPublicKey
public SSH2ECDSASHA2NIST(java.lang.String algo, java.lang.String sshname, java.lang.String curve)
public byte[] sign(byte[] data) throws SSH2SignatureException
SSH2Signature
sign
in interface SSH2PKISigner
sign
in class SSH2Signature
data
- Data to sign.SSH2SignatureException
public boolean verify(byte[] sigBlob, byte[] data) throws SSH2SignatureException
SSH2Signature
verify
in class SSH2Signature
sigBlob
- Signature blob encoded in the ssh format.data
- Signed data.SSH2SignatureException
protected byte[] encodePublicKey(java.security.PublicKey publicKey) throws SSH2Exception
SSH2Signature
encodePublicKey
in class SSH2Signature
publicKey
- The public key to encode. Must be an instance of
DSAPublicKey
.SSH2Exception
public static java.security.spec.ECParameterSpec getParamsForCurve(java.lang.String curve)
protected java.security.PublicKey decodePublicKey(byte[] pubKeyBlob) throws SSH2Exception
SSH2Signature
decodePublicKey
in class SSH2Signature
pubKeyBlob
- A byte array containing a public key blob.Publickey
instance.SSH2Exception