summaryrefslogtreecommitdiffstatsabout
path: root/sshlib/src/main/java/com/trilead/ssh2/signature/TokenRSAPrivateKey.java
blob: 4438cab5acac04f831090dd13eeb40299b3607e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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];
  }
}