public class Ssh2RsaPublicKey extends Object implements SshRsaPublicKey
| Constructor and Description |
|---|
Ssh2RsaPublicKey() |
Ssh2RsaPublicKey(BigInteger modulus,
BigInteger publicExponent) |
Ssh2RsaPublicKey(BigInteger modulus,
BigInteger publicExponent,
SecurityLevel securityLevel,
int priority) |
Ssh2RsaPublicKey(RSAPublicKey pubKey) |
Ssh2RsaPublicKey(RSAPublicKey pubKey,
SecurityLevel securityLevel,
int priority) |
Ssh2RsaPublicKey(SecurityLevel securityLevel,
int priority)
Default constructor for initializing the key from a byte array using the
init method.
|
| 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 |
getEncodingAlgorithm()
The algorithm name used in the encoding of the public key
|
String |
getFingerprint()
Return an SSH fingerprint of the public key
|
PublicKey |
getJCEPublicKey()
Get the JCE component of this key.
|
BigInteger |
getModulus() |
int |
getPriority() |
BigInteger |
getPublicExponent() |
SecurityLevel |
getSecurityLevel() |
int |
getSignatureLength() |
String |
getSigningAlgorithm()
The algorithm name expected to be encoded in SSH signatures
|
int |
getVersion() |
int |
hashCode() |
void |
init(byte[] blob,
int start,
int len)
Initialize the public key from a blob of binary data.
|
String |
test()
Test the JCE for algorithm availability.
|
boolean |
verifySignature(byte[] signature,
byte[] data)
Verify the signature.
|
public Ssh2RsaPublicKey()
public Ssh2RsaPublicKey(RSAPublicKey pubKey)
public Ssh2RsaPublicKey(SecurityLevel securityLevel, int priority)
public Ssh2RsaPublicKey(RSAPublicKey pubKey, SecurityLevel securityLevel, int priority)
public Ssh2RsaPublicKey(BigInteger modulus, BigInteger publicExponent) throws InvalidKeySpecException, NoSuchAlgorithmException
public Ssh2RsaPublicKey(BigInteger modulus, BigInteger publicExponent, SecurityLevel securityLevel, int priority) throws NoSuchAlgorithmException, InvalidKeySpecException
public SecurityLevel getSecurityLevel()
getSecurityLevel in interface SecureComponentpublic int getPriority()
getPriority in interface SecureComponentpublic byte[] getEncoded()
throws SshException
SshPublicKeygetEncoded in interface SshPublicKeySshExceptionpublic String getFingerprint() throws SshException
SshPublicKeygetFingerprint in interface SshPublicKeySshExceptionpublic int getBitLength()
SshPublicKeygetBitLength in interface SshPublicKeypublic String getEncodingAlgorithm()
SshPublicKeygetEncodingAlgorithm in interface SshPublicKeypublic void init(byte[] blob,
int start,
int len)
throws SshException
SshPublicKeyinit in interface SshPublicKeySshExceptionpublic String getAlgorithm()
SshPublicKeygetAlgorithm in interface SshPublicKeygetAlgorithm in interface SecureComponentpublic boolean verifySignature(byte[] signature,
byte[] data)
throws SshException
SshPublicKeyverifySignature in interface SshPublicKeytrue if the signature was produced by the corresponding
private key that owns this public key, otherwise false.SshExceptionpublic int getSignatureLength()
public BigInteger doPublic(BigInteger input) throws SshException
doPublic in interface SshRsaPublicKeySshExceptionpublic BigInteger getModulus()
getModulus in interface SshRsaPublicKeypublic BigInteger getPublicExponent()
getPublicExponent in interface SshRsaPublicKeypublic int getVersion()
getVersion in interface SshRsaPublicKeypublic PublicKey getJCEPublicKey()
SshPublicKeygetJCEPublicKey in interface SshPublicKeygetJCEPublicKey in interface SshRsaPublicKeypublic String test()
SshPublicKeytest in interface SshPublicKeypublic String getSigningAlgorithm()
SshPublicKeygetSigningAlgorithm in interface SshPublicKeyCopyright © 2025. All rights reserved.