2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 package java.security;
20 import java.security.spec.AlgorithmParameterSpec;
23 * {@code KeyPairGeneratorSpi} is the Service Provider Interface (SPI)
24 * definition for {@link KeyPairGenerator}.
26 * @see KeyPairGenerator
28 public abstract class KeyPairGeneratorSpi {
30 * Constructs a new instance of {@code KeyPairGeneratorSpi}.
32 public KeyPairGeneratorSpi() {
36 * Computes and returns a new unique {@code KeyPair} each time this method
39 * @return a new unique {@code KeyPair} each time this method is called.
41 public abstract KeyPair generateKeyPair();
44 * Initializes this {@code KeyPairGeneratorSpi} with the given key size and
45 * the given {@code SecureRandom}. The default parameter set will be used.
48 * the key size (number of bits).
50 * the source of randomness.
52 public abstract void initialize(int keysize, SecureRandom random);
55 * Initializes this {@code KeyPairGeneratorSpi} with the given {@code
56 * AlgorithmParameterSpec} and the given {@code SecureRandom}.
59 * the parameters to use.
61 * the source of randomness.
62 * @throws InvalidAlgorithmParameterException
63 * if the specified parameters are not supported.
65 public void initialize(AlgorithmParameterSpec params, SecureRandom random)
66 throws InvalidAlgorithmParameterException {
67 throw new UnsupportedOperationException();