Top Description Fields Constructors Methods
org.conscrypt

public final Class OpenSSLECKeyPairGenerator

extends KeyPairGenerator
Class Inheritance
Annotations
@Internal
Imports
java.security.InvalidAlgorithmParameterException, .InvalidParameterException, .KeyPair, .KeyPairGenerator, .SecureRandom, java.security.spec.AlgorithmParameterSpec, .ECGenParameterSpec, .ECParameterSpec, java.util.ArrayList, .Arrays, .HashMap, .Map

An implementation of KeyPairGenerator for EC keys which uses BoringSSL to perform all the operations.

Field Summary

Modifier and TypeField and Description
private static final String
private static final int
private OpenSSLECGroupContext
private static final Map<Integer, String>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
assertCurvesAreValid()

For testing.

public KeyPair
public void
initialize(int
the keysize. This is an algorithm-specific metric, such as modulus length, specified in number of bits.
keysize
,
SecureRandom
the source of randomness.
random
)

Overrides java.security.KeyPairGenerator.initialize.

Initializes the key pair generator for a certain keysize with the given source of randomness (and a default parameter set).
public void
initialize(AlgorithmParameterSpec
the parameter set used to generate the keys.
param
,
SecureRandom
the source of randomness.
random
)

Overrides java.security.KeyPairGenerator.initialize.

Initializes the key pair generator with the given parameter set and source of randomness.
Inherited from java.security.KeyPairGenerator:
genKeyPairgetAlgorithmgetInstancegetInstancegetInstancegetProviderinitializeinitialize

Field Detail

ALGORITHMback to summary
private static final String ALGORITHM
DEFAULT_KEY_SIZEback to summary
private static final int DEFAULT_KEY_SIZE
groupback to summary
private OpenSSLECGroupContext group
SIZE_TO_CURVE_NAMEback to summary
private static final Map<Integer, String> SIZE_TO_CURVE_NAME

Constructor Detail

OpenSSLECKeyPairGeneratorback to summary
public OpenSSLECKeyPairGenerator()

Method Detail

assertCurvesAreValidback to summary
public static void assertCurvesAreValid()

For testing.

generateKeyPairback to summary
public KeyPair generateKeyPair()

Overrides java.security.KeyPairGenerator.generateKeyPair.

Doc from java.security.KeyPairGenerator.generateKeyPair.

Generates a key pair.

If this KeyPairGenerator has not been initialized explicitly, provider-specific defaults will be used for the size and other (algorithm-specific) values of the generated keys.

This will generate a new key pair every time it is called.

This method is functionally equivalent to genKeyPair.

Returns:KeyPair

the generated key pair

Annotations
@Override
initializeback to summary
public void initialize(int keysize, SecureRandom random)

Overrides java.security.KeyPairGenerator.initialize.

Doc from java.security.KeyPairGenerator.initialize.

Initializes the key pair generator for a certain keysize with the given source of randomness (and a default parameter set).

Parameters
keysize:int

the keysize. This is an algorithm-specific metric, such as modulus length, specified in number of bits.

random:SecureRandom

the source of randomness.

Annotations
@Override
initializeback to summary
public void initialize(AlgorithmParameterSpec param, SecureRandom random) throws InvalidAlgorithmParameterException

Overrides java.security.KeyPairGenerator.initialize.

Doc from java.security.KeyPairGenerator.initialize.

Initializes the key pair generator with the given parameter set and source of randomness.

This concrete method has been added to this previously-defined abstract class. This method calls the KeyPairGeneratorSpi initialize method, passing it params and random. That initialize method always throws an UnsupportedOperationException if it is not overridden by the provider.

Parameters
param:AlgorithmParameterSpec

the parameter set used to generate the keys.

random:SecureRandom

the source of randomness.

Annotations
@Override
Exceptions
InvalidAlgorithmParameterException:
if the given parameters are inappropriate for this key pair generator.