net.adamcin.httpsig.ssh.jsch
Class JschKey

java.lang.Object
  extended by net.adamcin.httpsig.ssh.jsch.JschKey
All Implemented Interfaces:
Key, FingerprintableKey

public class JschKey
extends Object
implements FingerprintableKey


Constructor Summary
JschKey(com.jcraft.jsch.Identity identity)
           
 
Method Summary
 boolean canSign()
           
 boolean canVerify()
           
 Set<Algorithm> getAlgorithms()
           
 String getFingerprint()
           
 String getId()
           
static Keychain getIdentities(com.jcraft.jsch.JSch jSch)
           
 byte[] sign(Algorithm algorithm, byte[] challengeHash)
          
 boolean verify(Algorithm algorithm, byte[] challengeHash, byte[] signatureBytes)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JschKey

public JschKey(com.jcraft.jsch.Identity identity)
Method Detail

getId

public String getId()
Specified by:
getId in interface Key

getFingerprint

public String getFingerprint()
Specified by:
getFingerprint in interface FingerprintableKey

getAlgorithms

public Set<Algorithm> getAlgorithms()
Specified by:
getAlgorithms in interface Key

verify

public boolean verify(Algorithm algorithm,
                      byte[] challengeHash,
                      byte[] signatureBytes)

Specified by:
verify in interface Key
Parameters:
algorithm - the selected Signature Algorithm
challengeHash - the result of RequestContent.getContent(java.util.List, java.nio.charset.Charset)
signatureBytes - the result of Authorization.getSignatureBytes()
Returns:

canVerify

public boolean canVerify()
Specified by:
canVerify in interface Key

canSign

public boolean canSign()
Specified by:
canSign in interface Key

sign

public byte[] sign(Algorithm algorithm,
                   byte[] challengeHash)

Specified by:
sign in interface Key
Parameters:
algorithm - the selected Signature Algorithm
challengeHash - the result of RequestContent.getContent(java.util.List, java.nio.charset.Charset)
Returns:

getIdentities

public static Keychain getIdentities(com.jcraft.jsch.JSch jSch)


Copyright © 2013-2014. All Rights Reserved.