public class OpenSshRsaCertificate extends OpenSshCertificate implements SshRsaPublicKey
Modifier and Type | Field and Description |
---|---|
static String |
SSH_RSA_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 |
---|
OpenSshRsaCertificate()
Default constructor for initializing the key from a byte array using the
init method.
|
OpenSshRsaCertificate(BigInteger modulus,
BigInteger publicExponent) |
OpenSshRsaCertificate(RSAPublicKey pubKey) |
Modifier and Type | Method and Description |
---|---|
BigInteger |
doPublic(BigInteger input) |
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
|
PublicKey |
getJCEPublicKey() |
BigInteger |
getModulus() |
BigInteger |
getPublicExponent() |
int |
getVersion() |
int |
hashCode() |
void |
init(byte[] blob,
int start,
int len)
Initialize the public key from a blob of binary data.
|
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_RSA_CERT_V01
public OpenSshRsaCertificate()
public OpenSshRsaCertificate(RSAPublicKey pubKey)
public OpenSshRsaCertificate(BigInteger modulus, BigInteger publicExponent) throws NoSuchAlgorithmException, InvalidKeySpecException
public byte[] getEncoded() throws SshException
SshPublicKey
getEncoded
in interface SshPublicKey
SshException
public String getFingerprint() throws SshException
SshPublicKey
getFingerprint
in interface SshPublicKey
SshException
public int getBitLength()
SshPublicKey
getBitLength
in interface SshPublicKey
public void init(byte[] blob, int start, int len) throws SshException
SshPublicKey
init
in interface SshPublicKey
SshException
public String getAlgorithm()
SshPublicKey
getAlgorithm
in interface SshPublicKey
public boolean verifySignature(byte[] signature, byte[] data) throws SshException
SshPublicKey
verifySignature
in interface SshPublicKey
true
if the signature was produced by the corresponding
private key that owns this public key, otherwise false
.SshException
public BigInteger doPublic(BigInteger input) throws SshException
doPublic
in interface SshRsaPublicKey
SshException
public BigInteger getModulus()
getModulus
in interface SshRsaPublicKey
public BigInteger getPublicExponent()
getPublicExponent
in interface SshRsaPublicKey
public int getVersion()
getVersion
in interface SshRsaPublicKey
public PublicKey getJCEPublicKey()
getJCEPublicKey
in interface SshRsaPublicKey
Copyright © 2016. All rights reserved.