com.maverick.ssh.components.standalone
Class Ssh2DsaPublicKey
java.lang.Object
com.maverick.crypto.publickey.DsaKey
com.maverick.crypto.publickey.DsaPublicKey
com.maverick.ssh.components.standalone.Ssh2DsaPublicKey
- All Implemented Interfaces:
- com.maverick.crypto.publickey.PublicKey, SshDsaPublicKey, SshPublicKey
public class Ssh2DsaPublicKey
- extends com.maverick.crypto.publickey.DsaPublicKey
- implements SshDsaPublicKey
Represents an SSH2 DSA public key.
- Author:
- Lee David Painter
| Fields inherited from class com.maverick.crypto.publickey.DsaPublicKey |
y |
| Fields inherited from class com.maverick.crypto.publickey.DsaKey |
g, p, q |
| Methods inherited from class com.maverick.crypto.publickey.DsaPublicKey |
getBitLength, getY, verifySignature |
| Methods inherited from class com.maverick.crypto.publickey.DsaKey |
getG, getP, getQ |
Ssh2DsaPublicKey
public Ssh2DsaPublicKey(BigInteger p,
BigInteger q,
BigInteger g,
BigInteger y)
- Construct a DSA key from the parameters.
- Parameters:
p - q - g - y -
Ssh2DsaPublicKey
public Ssh2DsaPublicKey()
- Default contructor used to initialize the key from an encoded byte array
using the init method.
getAlgorithm
public String getAlgorithm()
- The algorithm name is "ssh-dss"
- Specified by:
getAlgorithm in interface SshPublicKey
getEncoded
public byte[] getEncoded()
throws SshException
- Returns the key encoded into a byte array as defined in the SSH Transport
Protocol.
The "ssh-dss" public key format has the following specific encoding:
String "ssh-dss"
BigInteger p
BigInteger q
BigInteger g
BigInteger y
- Specified by:
getEncoded in interface SshPublicKey
- Returns:
- the encoded format.
- Throws:
SshException
getFingerprint
public String getFingerprint()
throws SshException
- Specified by:
getFingerprint in interface SshPublicKey
- Throws:
SshException
init
public void init(byte[] blob,
int start,
int len)
throws SshException
- Initialize the public key from an SSH2 key blob
- Specified by:
init in interface SshPublicKey
- Parameters:
blob - the SSH2 encoded keystart - the offset in the key data to start readinglen - the length of the key data
- Throws:
IOException
SshException
verifySignature
public boolean verifySignature(byte[] signature,
byte[] data)
- Specified by:
verifySignature in interface SshPublicKey- Overrides:
verifySignature in class com.maverick.crypto.publickey.DsaPublicKey
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
Copyright © 2012. All Rights Reserved.