public final class MutableKeyCreationRegistry extends Object
Key objects from Parameters with new randomness.| Modifier and Type | Class and Description |
|---|---|
static interface |
MutableKeyCreationRegistry.KeyCreator<ParametersT extends Parameters>
A class to create key objects from parameters with given randomness.
|
| Constructor and Description |
|---|
MutableKeyCreationRegistry() |
| Modifier and Type | Method and Description |
|---|---|
<ParametersT extends Parameters> |
add(MutableKeyCreationRegistry.KeyCreator<ParametersT> creator,
Class<ParametersT> parametersClass)
Adds a new "InsecureKeyCreator" to the instance.
|
Key |
createKey(Parameters parameters,
Integer idRequirement)
Creates a
Key from a given Parameters object. |
static MutableKeyCreationRegistry |
globalInstance() |
public static MutableKeyCreationRegistry globalInstance()
public <ParametersT extends Parameters> void add(MutableKeyCreationRegistry.KeyCreator<ParametersT> creator, Class<ParametersT> parametersClass) throws GeneralSecurityException
If a creator for this class has been added previously, the two instances have to be equal.
Otherwise, this method throws a GeneralSecurityException.
GeneralSecurityExceptionpublic Key createKey(Parameters parameters, @Nullable Integer idRequirement) throws GeneralSecurityException
Key from a given Parameters object.
Finds the previously added creator (with add(com.google.crypto.tink.internal.MutableKeyCreationRegistry.KeyCreator<ParametersT>, java.lang.Class<ParametersT>)) for the class given by parameters.getClass() and uses it.
GeneralSecurityException