Class OpenSshRsaSha512Certificate
java.lang.Object
com.sshtools.common.publickey.OpenSshCertificate
com.sshtools.common.ssh.components.jce.OpenSshRsaSha512Certificate
- All Implemented Interfaces:
Component,SshPublicKey,SshRsaPublicKey,SecureComponent
A RSA public key implementation which uses a JCE provider.
- Author:
- Lee David Painter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
FieldsFields inherited from class com.sshtools.common.publickey.OpenSshCertificate
OPTION_FORCE_COMMAND, OPTION_SOURCE_ADDRESS, PERMIT_AGENT_FORWARDING, PERMIT_PORT_FORWARDING, PERMIT_USER_PTY, PERMIT_USER_RC, PERMIT_X11_FORWARDING, publicKey, SSH_CERT_TYPE_HOST, SSH_CERT_TYPE_USER -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for initializing the key from a byte array using the init method.OpenSshRsaSha512Certificate(BigInteger modulus, BigInteger publicExponent) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddecodePublicKey(com.sshtools.common.util.ByteArrayReader reader) doPublic(BigInteger input) booleanGet the algorithm name for the public key.intGet the bit length of the public keyThe algorithm name used in the encoding of the public keyReturn the JCE component for this key.intThe algorithm name expected to be encoded in SSH signaturesintinthashCode()test()Test the JCE for algorithm availability.booleanverifySignature(byte[] signature, byte[] data) Verify the signature.Methods inherited from class com.sshtools.common.publickey.OpenSshCertificate
decodeCertificate, encodeCertificate, getCriticalOptionsList, getEncoded, getExtension, getExtensions, getExtensionsList, getExtensionsMap, getFingerprint, getForcedCommand, getKeyId, getPrincipals, getSerial, getSignedBy, getSignedKey, getSourceAddresses, getType, getValidAfter, getValidBefore, init, isForceCommand, isHostCertificate, isUserCertificate, sign, verifyMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sshtools.common.ssh.components.SshPublicKey
getEncoded, getFingerprint, init, init, isCertificate
-
Field Details
-
SSH_RSA_SHA2_512_CERT_V01
- See Also:
-
-
Constructor Details
-
OpenSshRsaSha512Certificate
public OpenSshRsaSha512Certificate()Default constructor for initializing the key from a byte array using the init method. -
OpenSshRsaSha512Certificate
-
OpenSshRsaSha512Certificate
public OpenSshRsaSha512Certificate(BigInteger modulus, BigInteger publicExponent) throws NoSuchAlgorithmException, InvalidKeySpecException
-
-
Method Details
-
getSecurityLevel
- Specified by:
getSecurityLevelin interfaceSecureComponent
-
getPriority
public int getPriority()- Specified by:
getPriorityin interfaceSecureComponent
-
getBitLength
public int getBitLength()Description copied from interface:SshPublicKeyGet the bit length of the public key- Specified by:
getBitLengthin interfaceSshPublicKey- Returns:
- the bit length of the public key
-
decodePublicKey
protected void decodePublicKey(com.sshtools.common.util.ByteArrayReader reader) throws IOException, SshException - Specified by:
decodePublicKeyin classOpenSshCertificate- Throws:
IOExceptionSshException
-
getAlgorithm
Description copied from interface:SshPublicKeyGet the algorithm name for the public key.- Specified by:
getAlgorithmin interfaceSecureComponent- Specified by:
getAlgorithmin interfaceSshPublicKey- Returns:
- the algorithm name, for example "ssh-dss"
-
getEncodingAlgorithm
Description copied from interface:SshPublicKeyThe algorithm name used in the encoding of the public key- Specified by:
getEncodingAlgorithmin interfaceSshPublicKey- Overrides:
getEncodingAlgorithmin classOpenSshCertificate
-
verifySignature
Description copied from interface:SshPublicKeyVerify the signature.- Specified by:
verifySignaturein interfaceSshPublicKey- Returns:
trueif the signature was produced by the corresponding private key that owns this public key, otherwisefalse.- Throws:
SshException
-
equals
-
hashCode
public int hashCode() -
getVersion
public int getVersion()- Specified by:
getVersionin interfaceSshRsaPublicKey
-
getJCEPublicKey
Description copied from interface:SshPublicKeyReturn the JCE component for this key.- Specified by:
getJCEPublicKeyin interfaceSshPublicKey- Specified by:
getJCEPublicKeyin interfaceSshRsaPublicKey- Returns:
-
test
Description copied from interface:SshPublicKeyTest the JCE for algorithm availability.- Specified by:
testin interfaceSshPublicKey- Returns:
-
getSigningAlgorithm
Description copied from interface:SshPublicKeyThe algorithm name expected to be encoded in SSH signatures- Specified by:
getSigningAlgorithmin interfaceSshPublicKey
-
getModulus
- Specified by:
getModulusin interfaceSshRsaPublicKey
-
getPublicExponent
- Specified by:
getPublicExponentin interfaceSshRsaPublicKey
-
doPublic
- Specified by:
doPublicin interfaceSshRsaPublicKey- Throws:
SshException
-