public class Ssh2RsaPublicKey extends java.lang.Object implements SshRsaPublicKey
| Modifier and Type | Field and Description |
|---|---|
protected java.security.interfaces.RSAPublicKey |
pubKey |
| Constructor and Description |
|---|
Ssh2RsaPublicKey()
Default constructor for initializing the key from a byte array using the
init method.
|
Ssh2RsaPublicKey(java.math.BigInteger modulus,
java.math.BigInteger publicExponent) |
Ssh2RsaPublicKey(java.security.interfaces.RSAPublicKey pubKey) |
| Modifier and Type | Method and Description |
|---|---|
java.math.BigInteger |
doPublic(java.math.BigInteger input) |
boolean |
equals(java.lang.Object obj) |
java.lang.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.
|
java.lang.String |
getEncodingAlgorithm()
The algorithm name used in the encoding of the public key
|
java.lang.String |
getFingerprint()
Return an SSH fingerprint of the public key
|
java.security.PublicKey |
getJCEPublicKey()
Return the JCE component for this key.
|
java.math.BigInteger |
getModulus() |
int |
getPriority() |
java.math.BigInteger |
getPublicExponent() |
SecurityLevel |
getSecurityLevel() |
int |
getSignatureLength() |
java.lang.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.
|
java.lang.String |
test()
Test the JCE for algorithm availability.
|
boolean |
verifySignature(byte[] signature,
byte[] data)
Verify the signature.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitisCertificatepublic Ssh2RsaPublicKey()
public Ssh2RsaPublicKey(java.security.interfaces.RSAPublicKey pubKey)
public Ssh2RsaPublicKey(java.math.BigInteger modulus,
java.math.BigInteger publicExponent)
throws java.security.NoSuchAlgorithmException,
java.security.spec.InvalidKeySpecException
java.security.NoSuchAlgorithmExceptionjava.security.spec.InvalidKeySpecExceptionpublic SecurityLevel getSecurityLevel()
getSecurityLevel in interface SecureComponentpublic int getPriority()
getPriority in interface SecureComponentpublic byte[] getEncoded()
throws SshException
SshPublicKeygetEncoded in interface SshPublicKeySshExceptionpublic java.lang.String getFingerprint()
throws SshException
SshPublicKeygetFingerprint in interface SshPublicKeySshExceptionpublic int getBitLength()
SshPublicKeygetBitLength in interface SshPublicKeypublic java.lang.String getEncodingAlgorithm()
SshPublicKeygetEncodingAlgorithm in interface SshPublicKeypublic void init(byte[] blob,
int start,
int len)
throws SshException
SshPublicKeyinit in interface SshPublicKeySshExceptionpublic java.lang.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 boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.math.BigInteger doPublic(java.math.BigInteger input)
throws SshException
doPublic in interface SshRsaPublicKeySshExceptionpublic java.math.BigInteger getModulus()
getModulus in interface SshRsaPublicKeypublic java.math.BigInteger getPublicExponent()
getPublicExponent in interface SshRsaPublicKeypublic int getVersion()
getVersion in interface SshRsaPublicKeypublic java.security.PublicKey getJCEPublicKey()
SshPublicKeygetJCEPublicKey in interface SshPublicKeygetJCEPublicKey in interface SshRsaPublicKeypublic java.lang.String test()
SshPublicKeytest in interface SshPublicKeypublic java.lang.String getSigningAlgorithm()
SshPublicKeygetSigningAlgorithm in interface SshPublicKeyCopyright © 2022. All rights reserved.