1561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes/*
2561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  Licensed to the Apache Software Foundation (ASF) under one or more
3561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  contributor license agreements.  See the NOTICE file distributed with
4561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  this work for additional information regarding copyright ownership.
5561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  The ASF licenses this file to You under the Apache License, Version 2.0
6561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  (the "License"); you may not use this file except in compliance with
7561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  the License.  You may obtain a copy of the License at
8561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *
9561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *     http://www.apache.org/licenses/LICENSE-2.0
10561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *
11561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  Unless required by applicable law or agreed to in writing, software
12561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  distributed under the License is distributed on an "AS IS" BASIS,
13561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  See the License for the specific language governing permissions and
15561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *  limitations under the License.
16561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes */
17561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
18561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes/**
19561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes* @author Vera Y. Petrashkova
20561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes*/
21561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
22561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughespackage org.apache.harmony.security.tests.java.security.interfaces;
23561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
24561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
25561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughesimport java.math.BigInteger;
26561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughesimport java.security.interfaces.RSAPrivateCrtKey;
27561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
28561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughesimport junit.framework.TestCase;
29561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
30561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes/**
31561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes * Tests for <code>RSAPrivateCrtKey</code> class field
32561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes *
33561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes */
34561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughespublic class RSAPrivateCrtKeyTest extends TestCase {
35561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
36561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    /**
37561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes     * Constructor for RSAPrivateCrtKeyTest.
38561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes     *
39561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes     * @param arg0
40561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes     */
41561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    public RSAPrivateCrtKeyTest(String arg0) {
42561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        super(arg0);
43561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    }
44561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
45561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    /**
46561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes     * Test for <code>serialVersionUID</code> field
47561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes     */
48561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    public void testField() {
49561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        checkRSAPrivateCrtKey key = new checkRSAPrivateCrtKey();
50561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        assertEquals("Incorrect serialVersionUID",
51561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes                key.getSerVerUID(), //RSAPrivateCrtKey.serialVersionUID
52561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes                -5682214253527700368L);
53561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    }
54561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    public class checkRSAPrivateCrtKey implements RSAPrivateCrtKey {
55561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        public String getAlgorithm() {
56561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            return "RSAPrivateCrtKey";
57561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        }
58561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        public String getFormat() {
59561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            return "Format";
60561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        }
61561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        public byte[] getEncoded() {
62561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            return new byte[0];
63561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        }
64561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        public long getSerVerUID() {
65561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            return serialVersionUID;
66561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        }
67561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        public BigInteger getCrtCoefficient() {
68561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            return null;
69561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        }
70561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        public BigInteger getPrimeP() {
71561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            return null;
72561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        }
73561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        public BigInteger getPrimeQ() {
74561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            return null;
75561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        }
76561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        public BigInteger getPrimeExponentP() {
77561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            return null;
78561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        }
79561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        public BigInteger getPrimeExponentQ() {
80561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            return null;
81561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        }
82561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        public BigInteger getPublicExponent() {
83561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            return null;
84561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        }
85561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        public BigInteger getModulus() {
86561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            return null;
87561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        }
88561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        public BigInteger getPrivateExponent() {
89561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes            return null;
90561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes        }
91561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes
92561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes    }
93561ee011997c6c2f1befbfaa9d5f0a99771c1d63Elliott Hughes}
94