summaryrefslogtreecommitdiff
path: root/jessie-tests/gnu/javax/net/ssl/provider/testServerRSAParams.java
blob: b40518613aecd96246af4c5a838d99cfd02b2757 (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


package gnu.javax.net.ssl.provider;

import java.math.BigInteger;
import java.nio.ByteBuffer;

class testServerRSAParams
{
  public static void main (String[] argv) throws Throwable
  {
    BigInteger modulus = new BigInteger ("1234567890abcdef1234567890abcdef1234567890abcdef", 16);
    BigInteger exponent = BigInteger.valueOf (0xff);
    ByteBuffer buffer = ByteBuffer.allocate (1024);

    ServerRSAParams params = new ServerRSAParams (buffer);

    params.setModulus (modulus);
    params.setExponent (exponent);

    if (!params.getModulus ().equals (modulus))
      System.out.println ("FAIL: " + modulus + " != " + params.getModulus ());
    if (!params.getExponent ().equals (exponent))
      System.out.println ("FAIL: " + exponent + " != " + params.getExponent ());

    System.err.println (params);
  }
}