public final class SSHKey extends Object implements FingerprintableKey
Key
implementation for OpenSSH-compliant keys (RSA/DSA)Constructor and Description |
---|
SSHKey(KeyFormat keyFormat,
KeyPair keyPair) |
SSHKey(KeyFormat keyFormat,
PublicKey publicKey,
PrivateKey privateKey) |
Modifier and Type | Method and Description |
---|---|
boolean |
canSign() |
boolean |
canVerify() |
boolean |
equals(Object o) |
Set<Algorithm> |
getAlgorithms() |
String |
getFingerprint() |
String |
getId() |
int |
hashCode() |
byte[] |
sign(Algorithm algorithm,
byte[] challengeHash)
Signs the
challengeHash using the specified signature Algorithm |
boolean |
verify(Algorithm algorithm,
byte[] challengeHash,
byte[] signatureBytes)
Verifies the
signatureBytes against the challengeHash using an underlying public key |
public SSHKey(KeyFormat keyFormat, PublicKey publicKey, PrivateKey privateKey)
public String getId()
public String getFingerprint()
getFingerprint
in interface FingerprintableKey
public Set<Algorithm> getAlgorithms()
getAlgorithms
in interface Key
Set
of Signature Algorithm
s supported by this key.public boolean canVerify()
public boolean canSign()
public boolean verify(Algorithm algorithm, byte[] challengeHash, byte[] signatureBytes)
signatureBytes
against the challengeHash
using an underlying public keyverify
in interface Key
algorithm
- the selected Signature Algorithm
challengeHash
- the result of RequestContent.getBytesToSign(java.util.List, java.nio.charset.Charset)
signatureBytes
- the result of Authorization.getSignatureBytes()
public byte[] sign(Algorithm algorithm, byte[] challengeHash)
challengeHash
using the specified signature Algorithm
sign
in interface Key
algorithm
- the selected Signature Algorithm
challengeHash
- the result of RequestContent.getBytesToSign(java.util.List, java.nio.charset.Charset)
Copyright © 2013-2017. All Rights Reserved.