com.mindbright.ssh2
Class SSH2Signature

java.lang.Object
  |
  +--com.mindbright.ssh2.SSH2Signature
All Implemented Interfaces:
SSH2PKISigner
Direct Known Subclasses:
SSH2SimpleSignature

public abstract class SSH2Signature
extends java.lang.Object
implements SSH2PKISigner


Field Summary
protected  java.lang.String algorithm
           
protected  com.mindbright.jca.security.PrivateKey privateKey
           
protected  byte[] pubKeyBlob
           
protected  com.mindbright.jca.security.PublicKey publicKey
           
protected  com.mindbright.jca.security.Signature signature
           
 
Constructor Summary
protected SSH2Signature()
           
 
Method Summary
protected abstract  com.mindbright.jca.security.PublicKey decodePublicKey(byte[] pubKeyBlob)
           
protected abstract  byte[] decodeSignature(byte[] sigBlob)
           
protected abstract  byte[] encodePublicKey(com.mindbright.jca.security.PublicKey publicKey)
           
protected abstract  byte[] encodeSignature(byte[] sigRaw)
           
 java.lang.String getAlgorithmName()
           
static SSH2Signature getEncodingInstance(java.lang.String algorithm)
           
static SSH2Signature getInstance(java.lang.String algorithm)
           
 com.mindbright.jca.security.PublicKey getPublicKey()
           
 byte[] getPublicKeyBlob()
           
protected abstract  java.lang.String getSignatureAlgorithm()
           
 void initSign(com.mindbright.jca.security.PrivateKey privateKey)
           
 void initVerify(byte[] pubKeyBlob)
           
 void initVerify(com.mindbright.jca.security.PublicKey publicKey)
           
 void setIncompatibility(SSH2Transport transport)
           
 void setPublicKey(com.mindbright.jca.security.PublicKey publicKey)
           
 byte[] sign(byte[] data)
           
 boolean verify(byte[] sigBlob, byte[] data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

algorithm

protected java.lang.String algorithm

signature

protected com.mindbright.jca.security.Signature signature

privateKey

protected com.mindbright.jca.security.PrivateKey privateKey

publicKey

protected com.mindbright.jca.security.PublicKey publicKey

pubKeyBlob

protected byte[] pubKeyBlob
Constructor Detail

SSH2Signature

protected SSH2Signature()
Method Detail

getInstance

public static SSH2Signature getInstance(java.lang.String algorithm)
                                 throws SSH2Exception
SSH2Exception

getEncodingInstance

public static SSH2Signature getEncodingInstance(java.lang.String algorithm)
                                         throws SSH2Exception
SSH2Exception

getAlgorithmName

public final java.lang.String getAlgorithmName()
Specified by:
getAlgorithmName in interface SSH2PKISigner

getPublicKeyBlob

public final byte[] getPublicKeyBlob()
                              throws SSH2SignatureException
Specified by:
getPublicKeyBlob in interface SSH2PKISigner
SSH2SignatureException

getPublicKey

public final com.mindbright.jca.security.PublicKey getPublicKey()
                                                         throws SSH2SignatureException
SSH2SignatureException

setPublicKey

public final void setPublicKey(com.mindbright.jca.security.PublicKey publicKey)

setIncompatibility

public void setIncompatibility(SSH2Transport transport)
Specified by:
setIncompatibility in interface SSH2PKISigner

initSign

public final void initSign(com.mindbright.jca.security.PrivateKey privateKey)
                    throws SSH2Exception
SSH2Exception

initVerify

public final void initVerify(com.mindbright.jca.security.PublicKey publicKey)
                      throws SSH2Exception
SSH2Exception

initVerify

public final void initVerify(byte[] pubKeyBlob)
                      throws SSH2Exception
SSH2Exception

sign

public final byte[] sign(byte[] data)
                  throws SSH2SignatureException
Specified by:
sign in interface SSH2PKISigner
SSH2SignatureException

verify

public final boolean verify(byte[] sigBlob,
                            byte[] data)
                     throws SSH2SignatureException
SSH2SignatureException

getSignatureAlgorithm

protected abstract java.lang.String getSignatureAlgorithm()

encodePublicKey

protected abstract byte[] encodePublicKey(com.mindbright.jca.security.PublicKey publicKey)
                                   throws SSH2Exception
SSH2Exception

decodePublicKey

protected abstract com.mindbright.jca.security.PublicKey decodePublicKey(byte[] pubKeyBlob)
                                                                  throws SSH2Exception
SSH2Exception

encodeSignature

protected abstract byte[] encodeSignature(byte[] sigRaw)

decodeSignature

protected abstract byte[] decodeSignature(byte[] sigBlob)
                                   throws SSH2SignatureException
SSH2SignatureException