com.maverick.ssh.components.jce
Class Ssh2EcdsaSha2NistPublicKey

java.lang.Object
  extended by com.maverick.ssh.components.jce.Ssh2EcdsaSha2NistPublicKey
All Implemented Interfaces:
SshComponent, SshPublicKey
Direct Known Subclasses:
Ssh2EcdsaSha2Nist256PublicKey, Ssh2EcdsaSha2Nist384PublicKey, Ssh2EcdsaSha2Nist521PublicKey

public class Ssh2EcdsaSha2NistPublicKey
extends Object
implements SshPublicKey


Constructor Summary
Ssh2EcdsaSha2NistPublicKey(ECPublicKey pub)
           
 
Method Summary
static ECPoint fromByteArray(byte[] b, EllipticCurve curve)
           
 int getBitLength()
          Get the bit length of the public key
 ECParameterSpec getCurveParams(String curve)
           
 byte[] getEncoded()
          Encode the public key into a blob of binary data, the encoded result will be passed into init to recreate the key.
 String getFingerprint()
          Return an SSH fingerprint of the public key
 PublicKey getJCEPublicKey()
           
 String getName()
          Get the algorithm name for the public key.
 void init(byte[] blob, int start, int len)
          Initialize the public key from a blob of binary data.
static byte[] toByteArray(ECPoint e, EllipticCurve curve)
           
 boolean verifySignature(byte[] signature, byte[] data)
          Verify the signature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ssh2EcdsaSha2NistPublicKey

public Ssh2EcdsaSha2NistPublicKey(ECPublicKey pub)
                           throws IOException
Throws:
IOException
Method Detail

init

public void init(byte[] blob,
                 int start,
                 int len)
          throws SshException
Description copied from interface: SshPublicKey
Initialize the public key from a blob of binary data.

Specified by:
init in interface SshPublicKey
Throws:
SshException

getName

public String getName()
Description copied from interface: SshPublicKey
Get the algorithm name for the public key.

Specified by:
getName in interface SshComponent
Specified by:
getName in interface SshPublicKey
Returns:
the algorithm name, for example "ssh-dss"

getBitLength

public int getBitLength()
Description copied from interface: SshPublicKey
Get the bit length of the public key

Specified by:
getBitLength in interface SshPublicKey
Returns:
the bit length of the public key

getEncoded

public byte[] getEncoded()
                  throws SshException
Description copied from interface: SshPublicKey
Encode the public key into a blob of binary data, the encoded result will be passed into init to recreate the key.

Specified by:
getEncoded in interface SshPublicKey
Returns:
an encoded byte array
Throws:
SshException

getFingerprint

public String getFingerprint()
                      throws SshException
Description copied from interface: SshPublicKey
Return an SSH fingerprint of the public key

Specified by:
getFingerprint in interface SshPublicKey
Returns:
String
Throws:
SshException

verifySignature

public boolean verifySignature(byte[] signature,
                               byte[] data)
                        throws SshException
Description copied from interface: SshPublicKey
Verify the signature.

Specified by:
verifySignature in interface SshPublicKey
Returns:
true if the signature was produced by the corresponding private key that owns this public key, otherwise false.
Throws:
SshException

getCurveParams

public ECParameterSpec getCurveParams(String curve)

toByteArray

public static byte[] toByteArray(ECPoint e,
                                 EllipticCurve curve)

fromByteArray

public static ECPoint fromByteArray(byte[] b,
                                    EllipticCurve curve)

getJCEPublicKey

public PublicKey getJCEPublicKey()


Copyright © 2013. All Rights Reserved.