public class OpenSshDsaCertificate extends OpenSshCertificate implements SshDsaPublicKey
Modifier and Type | Field and Description |
---|---|
protected DSAPublicKey |
pubkey |
static String |
SSH_DSS_CERT_V01 |
OPTION_FORCE_COMMAND, OPTION_SOURCE_ADDRESS, PERMIT_AGENT_FORWARDING, PERMIT_PORT_FORWARDING, PERMIT_USER_PTY, PERMIT_USER_RC, PERMIT_X11_FORWARDING, SSH_CERT_TYPE_HOST, SSH_CERT_TYPE_USER
Constructor and Description |
---|
OpenSshDsaCertificate() |
OpenSshDsaCertificate(BigInteger p,
BigInteger q,
BigInteger g,
BigInteger y) |
OpenSshDsaCertificate(DSAPublicKey pub) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getAlgorithm()
Get the algorithm name for the public key.
|
int |
getBitLength()
Get the bit length of the public key
|
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
|
BigInteger |
getG() |
DSAPublicKey |
getJCEPublicKey() |
BigInteger |
getP() |
BigInteger |
getQ() |
BigInteger |
getY() |
int |
hashCode() |
void |
init(byte[] blob,
int start,
int len)
Initialize the public key from a blob of binary data.
|
static void |
main(String[] args) |
String |
test()
Test the JCE for algorithm availability.
|
boolean |
verifySignature(byte[] signature,
byte[] data)
Verify the signature.
|
decode, encode, getExtensions, getForcedCommand, getKeyId, getPrincipals, getSerial, getSignedBy, getSourceAddresses, getType, getValidAfter, getValidBefore, isForceCommand
public static final String SSH_DSS_CERT_V01
protected DSAPublicKey pubkey
public OpenSshDsaCertificate()
public OpenSshDsaCertificate(DSAPublicKey pub)
public OpenSshDsaCertificate(BigInteger p, BigInteger q, BigInteger g, BigInteger y) throws NoSuchAlgorithmException, InvalidKeySpecException
public DSAPublicKey getJCEPublicKey()
getJCEPublicKey
in interface SshDsaPublicKey
public String getAlgorithm()
getAlgorithm
in interface SshPublicKey
public int getBitLength()
SshPublicKey
getBitLength
in interface SshPublicKey
public byte[] getEncoded() throws SshException
getEncoded
in interface SshPublicKey
SshException
public String getFingerprint() throws SshException
SshPublicKey
getFingerprint
in interface SshPublicKey
SshException
public void init(byte[] blob, int start, int len) throws SshException
init
in interface SshPublicKey
blob
- byte[]start
- intlen
- intSshException
public boolean verifySignature(byte[] signature, byte[] data) throws SshException
verifySignature
in interface SshPublicKey
signature
- byte[]data
- byte[]true
if the signature was produced by the
corresponding private key that owns this public key, otherwise
false
.SshException
public BigInteger getG()
getG
in interface SshDsaPublicKey
public BigInteger getP()
getP
in interface SshDsaPublicKey
public BigInteger getQ()
getQ
in interface SshDsaPublicKey
public BigInteger getY()
getY
in interface SshDsaPublicKey
public String test()
SshPublicKey
test
in interface SshPublicKey
Copyright © 2017. All rights reserved.