Class KeyPairIdentity
- java.lang.Object
-
- org.apache.sshd.client.auth.pubkey.KeyPairIdentity
-
- All Implemented Interfaces:
PublicKeyIdentity
public class KeyPairIdentity extends Object implements PublicKeyIdentity
Uses aKeyPair
to generate the identity signature- Author:
- Apache MINA SSHD Project
-
-
Constructor Summary
Constructors Constructor Description KeyPairIdentity(SignatureFactoriesManager primary, SignatureFactoriesManager secondary, KeyPair pair)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PublicKey
getPublicKey()
byte[]
sign(SessionContext session, byte[] data)
Proves the public key identity by signing the given dataString
toString()
-
-
-
Constructor Detail
-
KeyPairIdentity
public KeyPairIdentity(SignatureFactoriesManager primary, SignatureFactoriesManager secondary, KeyPair pair)
-
-
Method Detail
-
getPublicKey
public PublicKey getPublicKey()
- Specified by:
getPublicKey
in interfacePublicKeyIdentity
- Returns:
- The
PublicKey
identity value
-
sign
public byte[] sign(SessionContext session, byte[] data) throws Exception
Description copied from interface:PublicKeyIdentity
Proves the public key identity by signing the given data- Specified by:
sign
in interfacePublicKeyIdentity
- Parameters:
session
- TheSessionContext
for calling this method - may benull
if not called within a session contextdata
- Data to sign- Returns:
- Signed data - using the identity
- Throws:
Exception
- If failed to sign the data
-
-