Class AbstractSecurityKeySignature

java.lang.Object
org.apache.sshd.common.signature.AbstractSecurityKeySignature
All Implemented Interfaces:
AlgorithmNameProvider, Signature
Direct Known Subclasses:
SignatureSkECDSA, SignatureSkED25519

public abstract class AbstractSecurityKeySignature extends Object implements Signature
  • Field Details

  • Constructor Details

    • AbstractSecurityKeySignature

      protected AbstractSecurityKeySignature(String keyType)
  • Method Details

    • initVerifier

      public void initVerifier(SessionContext session, PublicKey key) throws GeneralSecurityException
      Specified by:
      initVerifier in interface Signature
      Parameters:
      session - The SessionContext for calling this method - may be null if not called within a session context
      key - The PublicKey to be used for verifying signatures
      Throws:
      GeneralSecurityException
    • update

      public void update(SessionContext session, byte[] hash, int off, int len)
      Description copied from interface: Signature
      Update the computed signature with the given data
      Specified by:
      update in interface Signature
      Parameters:
      session - The SessionContext for calling this method - may be null if not called within a session context
      hash - The hash data buffer
      off - Offset of hash data in buffer
      len - Length of hash data
    • getSignatureKeyType

      protected abstract String getSignatureKeyType()
    • getDelegateSignature

      protected abstract Signature getDelegateSignature()
    • verify

      public boolean verify(SessionContext session, byte[] sig) throws Exception
      Description copied from interface: Signature
      Verify against the given signature
      Specified by:
      verify in interface Signature
      Parameters:
      session - The SessionContext for calling this method - may be null if not called within a session context
      sig - The signed data
      Returns:
      true if signature is valid
      Throws:
      Exception - If failed to extract signed data for validation
    • initSigner

      public void initSigner(SessionContext session, PrivateKey key)
      Specified by:
      initSigner in interface Signature
      Parameters:
      session - The SessionContext for calling this method - may be null if not called within a session context
      key - The PrivateKey to be used for signing
    • sign

      public byte[] sign(SessionContext session)
      Description copied from interface: Signature
      Compute the signature
      Specified by:
      sign in interface Signature
      Parameters:
      session - The SessionContext for calling this method - may be null if not called within a session context
      Returns:
      The signature value