15850b60b2000dfdfd7c7bbe27d9ecee52d243933Jorg Pleumann/*
25850b60b2000dfdfd7c7bbe27d9ecee52d243933Jorg Pleumann * Copyright (C) 2009 The Android Open Source Project
35850b60b2000dfdfd7c7bbe27d9ecee52d243933Jorg Pleumann *
45850b60b2000dfdfd7c7bbe27d9ecee52d243933Jorg Pleumann * Licensed under the Apache License, Version 2.0 (the "License");
55850b60b2000dfdfd7c7bbe27d9ecee52d243933Jorg Pleumann * you may not use this file except in compliance with the License.
65850b60b2000dfdfd7c7bbe27d9ecee52d243933Jorg Pleumann * You may obtain a copy of the License at
75850b60b2000dfdfd7c7bbe27d9ecee52d243933Jorg Pleumann *
85850b60b2000dfdfd7c7bbe27d9ecee52d243933Jorg Pleumann *     http://www.apache.org/licenses/LICENSE-2.0
95850b60b2000dfdfd7c7bbe27d9ecee52d243933Jorg Pleumann *
105850b60b2000dfdfd7c7bbe27d9ecee52d243933Jorg Pleumann * Unless required by applicable law or agreed to in writing, software
115850b60b2000dfdfd7c7bbe27d9ecee52d243933Jorg Pleumann * distributed under the License is distributed on an "AS IS" BASIS,
125850b60b2000dfdfd7c7bbe27d9ecee52d243933Jorg Pleumann * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
135850b60b2000dfdfd7c7bbe27d9ecee52d243933Jorg Pleumann * See the License for the specific language governing permissions and
145850b60b2000dfdfd7c7bbe27d9ecee52d243933Jorg Pleumann * limitations under the License.
155850b60b2000dfdfd7c7bbe27d9ecee52d243933Jorg Pleumann */
164557728efb66c455a52b7669a8eefef7a9e54854Jesse Wilsonpackage libcore.javax.crypto.spec;
17adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project
18f979bbd1277c77ca945ad981e7864fb4e9f6ae05Jesse Wilsonimport java.security.KeyPair;
19adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Projectimport java.security.spec.RSAPrivateKeySpec;
20adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Projectimport java.security.spec.RSAPublicKeySpec;
21f979bbd1277c77ca945ad981e7864fb4e9f6ae05Jesse Wilsonimport tests.security.CipherAsymmetricCryptHelper;
22f979bbd1277c77ca945ad981e7864fb4e9f6ae05Jesse Wilsonimport tests.security.KeyFactoryTest;
23adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project
24adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Projectpublic class KeyFactoryTestRSA extends
25adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project        KeyFactoryTest<RSAPublicKeySpec, RSAPrivateKeySpec> {
26adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project
27adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project    @SuppressWarnings("unchecked")
28adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project    public KeyFactoryTestRSA() {
29f979bbd1277c77ca945ad981e7864fb4e9f6ae05Jesse Wilson        super("RSA", RSAPublicKeySpec.class, RSAPrivateKeySpec.class);
30adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project    }
31adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project
32420ea38aecdef0f5895c5e82751ebabe26bc0bd5Kenny Root    @Override
33420ea38aecdef0f5895c5e82751ebabe26bc0bd5Kenny Root    protected void check(KeyPair keyPair) throws Exception {
34f979bbd1277c77ca945ad981e7864fb4e9f6ae05Jesse Wilson        new CipherAsymmetricCryptHelper("RSA").test(keyPair);
35f979bbd1277c77ca945ad981e7864fb4e9f6ae05Jesse Wilson    }
36adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project}
37