Class KeyAgentIdentity

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private SshAgent agent  
      private java.lang.String comment  
      private java.security.PublicKey key  
    • Constructor Summary

      Constructors 
      Constructor Description
      KeyAgentIdentity​(SshAgent agent, java.security.PublicKey key, java.lang.String comment)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getComment()  
      java.security.PublicKey getPublicKey()  
      java.util.Map.Entry<java.lang.String,​byte[]> sign​(SessionContext session, java.lang.String algo, byte[] data)
      Proves the public key identity by signing the given data
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • key

        private final java.security.PublicKey key
      • comment

        private final java.lang.String comment
    • Constructor Detail

      • KeyAgentIdentity

        public KeyAgentIdentity​(SshAgent agent,
                                java.security.PublicKey key,
                                java.lang.String comment)
    • Method Detail

      • getPublicKey

        public java.security.PublicKey getPublicKey()
        Specified by:
        getPublicKey in interface PublicKeyIdentity
        Returns:
        The PublicKey identity value
      • getComment

        public java.lang.String getComment()
      • sign

        public java.util.Map.Entry<java.lang.String,​byte[]> sign​(SessionContext session,
                                                                       java.lang.String algo,
                                                                       byte[] data)
                                                                throws java.lang.Exception
        Description copied from interface: PublicKeyIdentity
        Proves the public key identity by signing the given data
        Specified by:
        sign in interface PublicKeyIdentity
        Parameters:
        session - The SessionContext for calling this method - may be null if not called within a session context
        algo - Recommended signature algorithm - if null/empty then one will be selected based on the key type and/or signature factories. Note: even if specific algorithm specified, the implementation may disregard and choose another
        data - Data to sign
        Returns:
        used algorithm + signed data - using the identity
        Throws:
        java.lang.Exception - If failed to sign the data
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object