Class SSHSignatureCallback

  • All Implemented Interfaces:
    java.io.Serializable, javax.security.auth.callback.Callback

    public class SSHSignatureCallback
    extends java.lang.Object
    implements javax.security.auth.callback.Callback, java.io.Serializable
    SSHSignatureCallback provides a Callback implementation used to perform SSH authentication. This callback is instantiated by the server with a random token which must be signed using the user's SSH private key.

    It is the responsibility of the callback handler to invoke the sign method and return this object in response to the callback.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long serialVersionUID  
    • Constructor Summary

      Constructors 
      Constructor Description
      SSHSignatureCallback​(byte[] token, byte[] serverSignature)
      Construct callback with a random token to be signed by the client.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] getServerSignature()  
      byte[] getSignature()  
      byte[] getToken()  
      boolean isSigned()  
      void sign​(java.lang.Object sshPrivateKey)
      Sign this challenge with the specified SSH private key.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SSHSignatureCallback

        public SSHSignatureCallback​(byte[] token,
                                    byte[] serverSignature)
        Construct callback with a random token to be signed by the client.
        Parameters:
        token - random bytes to be signed
    • Method Detail

      • getToken

        public byte[] getToken()
      • getSignature

        public byte[] getSignature()
      • getServerSignature

        public byte[] getServerSignature()
      • isSigned

        public boolean isSigned()
      • sign

        public void sign​(java.lang.Object sshPrivateKey)
                  throws java.io.IOException
        Sign this challenge with the specified SSH private key.
        Parameters:
        sshPrivateKey - RSAPrivateKey or DSAPrivateKey
        Throws:
        java.io.IOException - if signature generation failed
        See Also:
        RSAPrivateKey, DSAPrivateKey