net.schmizz.sshj.signature
Class AbstractSignature

java.lang.Object
  extended by net.schmizz.sshj.signature.AbstractSignature
All Implemented Interfaces:
Signature
Direct Known Subclasses:
SignatureDSA, SignatureRSA

public abstract class AbstractSignature
extends Object
implements Signature

An abstract class for Signature that implements common functionality.


Field Summary
protected  String algorithm
           
protected  Signature signature
           
 
Constructor Summary
protected AbstractSignature(String algorithm)
           
 
Method Summary
protected  byte[] extractSig(byte[] sig)
           
 void init(PublicKey publicKey, PrivateKey privateKey)
          Initialize this signature with the given public key and private key.
 void update(byte[] foo)
          Convenience method, same as calling Signature.update(byte[], int, int) with offset as 0 and H.length.
 void update(byte[] foo, int off, int len)
          Update the computed signature with the given data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.schmizz.sshj.signature.Signature
sign, verify
 

Field Detail

algorithm

protected final String algorithm

signature

protected Signature signature
Constructor Detail

AbstractSignature

protected AbstractSignature(String algorithm)
Method Detail

init

public void init(PublicKey publicKey,
                 PrivateKey privateKey)
Description copied from interface: Signature
Initialize this signature with the given public key and private key. If the private key is null, only signature verification can be performed.

Specified by:
init in interface Signature
Parameters:
publicKey - (null-ok) specify in case verification is needed
privateKey - (null-ok) specify in case signing is needed

update

public void update(byte[] foo)
Description copied from interface: Signature
Convenience method, same as calling Signature.update(byte[], int, int) with offset as 0 and H.length.

Specified by:
update in interface Signature
Parameters:
foo - the byte-array to update with

update

public void update(byte[] foo,
                   int off,
                   int len)
Description copied from interface: Signature
Update the computed signature with the given data.

Specified by:
update in interface Signature
Parameters:
foo - byte-array to update with
off - offset within the array
len - length until which to compute

extractSig

protected byte[] extractSig(byte[] sig)


Copyright © 2009-2012. All Rights Reserved.