net.adamcin.httpsig.ssh.jce
Class SSHKey

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

public final class SSHKey
extends Object
implements FingerprintableKey

Default Key implementation for OpenSSH-compliant keys (RSA/DSA)


Constructor Summary
SSHKey(KeyFormat keyFormat, KeyPair keyPair)
           
SSHKey(KeyFormat keyFormat, PublicKey publicKey, PrivateKey privateKey)
           
 
Method Summary
 boolean canSign()
          
 boolean canVerify()
          
 boolean equals(Object o)
          
 Set<Algorithm> getAlgorithms()
          
 String getFingerprint()
          
 String getId()
          
 int hashCode()
          
 byte[] sign(Algorithm algorithm, byte[] challengeHash)
          
 boolean verify(Algorithm algorithm, byte[] challengeHash, byte[] signatureBytes)
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SSHKey

public SSHKey(KeyFormat keyFormat,
              KeyPair keyPair)

SSHKey

public SSHKey(KeyFormat keyFormat,
              PublicKey publicKey,
              PrivateKey privateKey)
Method Detail

getId

public String getId()

Specified by:
getId in interface Key

getFingerprint

public String getFingerprint()

Specified by:
getFingerprint in interface FingerprintableKey
Returns:
the public key fingerprint

getAlgorithms

public Set<Algorithm> getAlgorithms()

Specified by:
getAlgorithms in interface Key

canVerify

public boolean canVerify()

Specified by:
canVerify in interface Key

canSign

public boolean canSign()

Specified by:
canSign in interface Key

verify

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

Specified by:
verify in interface Key

sign

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

Specified by:
sign in interface Key

equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object


Copyright © 2013-2014. All Rights Reserved.