diff options
author | hsm <hsm@lamia.panaceas.james.local> | 2016-05-29 04:17:53 +0100 |
---|---|---|
committer | hsm <hsm@lamia.panaceas.james.local> | 2016-05-29 17:13:25 +0100 |
commit | f8fffe5e29f55856b93b5e21f1a672bb1a0fec40 (patch) | |
tree | 298bb1053031648aaac04931061ae98e041498aa /sshlib/src/main/java/com/trilead/ssh2/signature/TokenRSAPrivateKey.java | |
parent | 362e6695b48ddf3d37fea426b4f48b2d0f07d9a0 (diff) | |
download | sshlib-f8fffe5e29f55856b93b5e21f1a672bb1a0fec40.tar.gz sshlib-f8fffe5e29f55856b93b5e21f1a672bb1a0fec40.tar.bz2 sshlib-f8fffe5e29f55856b93b5e21f1a672bb1a0fec40.zip |
Add support for auth with open-keychain
Diffstat (limited to 'sshlib/src/main/java/com/trilead/ssh2/signature/TokenRSAPrivateKey.java')
-rw-r--r-- | sshlib/src/main/java/com/trilead/ssh2/signature/TokenRSAPrivateKey.java | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/sshlib/src/main/java/com/trilead/ssh2/signature/TokenRSAPrivateKey.java b/sshlib/src/main/java/com/trilead/ssh2/signature/TokenRSAPrivateKey.java new file mode 100644 index 0000000..4438cab --- /dev/null +++ b/sshlib/src/main/java/com/trilead/ssh2/signature/TokenRSAPrivateKey.java @@ -0,0 +1,72 @@ + +package com.trilead.ssh2.signature; + +import java.io.IOException; +import java.io.ObjectOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectStreamException; +import java.math.BigInteger; +import java.security.InvalidKeyException; +import java.security.KeyFactory; +import java.security.NoSuchAlgorithmException; +import java.security.Signature; +import java.security.SignatureException; +import java.security.spec.InvalidKeySpecException; +import java.security.PrivateKey; +import java.security.spec.RSAPublicKeySpec; + +import com.trilead.ssh2.log.Logger; +import com.trilead.ssh2.packets.TypesReader; +import com.trilead.ssh2.packets.TypesWriter; + + +public class TokenRSAPrivateKey implements PrivateKey +{ + private long key_id; + + public TokenRSAPrivateKey (String s) + { + key_id = new BigInteger (s, 16).longValue(); + } + + public TokenRSAPrivateKey (long l) + { + key_id = l; + } + + public long getKeyId() + { + return key_id; + } + + private void writeObject (ObjectOutputStream stream) throws IOException + { + throw new IOException(); + } + + public void readObject (ObjectInputStream stream) throws IOException + { + throw new IOException(); + } + + public void readObjectNoData() throws ObjectStreamException + { + throw new ObjectStreamException() {}; + } + + public String getAlgorithm() + { + return "TokenRSA"; + } + + public String getFormat() + { + return "None"; + } + + public byte[] getEncoded() + { + return new byte[0]; + } +} + |