Package com.google.crypto.tink.internal
Class MutableKeyCreationRegistry
- java.lang.Object
-
- com.google.crypto.tink.internal.MutableKeyCreationRegistry
-
public final class MutableKeyCreationRegistry extends java.lang.ObjectStores methods to createKeyobjects fromParameterswith new randomness.
-
-
Constructor Summary
Constructors Constructor Description MutableKeyCreationRegistry()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <ParametersT extends Parameters>
voidadd(KeyCreator<ParametersT> creator, java.lang.Class<ParametersT> parametersClass)Adds a new "InsecureKeyCreator" to the instance.KeycreateKey(Parameters parameters, java.lang.Integer idRequirement)Creates aKeyfrom a givenParametersobject.static MutableKeyCreationRegistryglobalInstance()
-
-
-
Method Detail
-
globalInstance
public static MutableKeyCreationRegistry globalInstance()
-
add
public <ParametersT extends Parameters> void add(KeyCreator<ParametersT> creator, java.lang.Class<ParametersT> parametersClass) throws java.security.GeneralSecurityException
Adds a new "InsecureKeyCreator" to the instance.If a creator for this class has been added previously, the two instances have to be equal. Otherwise, this method throws a
GeneralSecurityException.- Throws:
java.security.GeneralSecurityException
-
createKey
public Key createKey(Parameters parameters, @Nullable java.lang.Integer idRequirement) throws java.security.GeneralSecurityException
Creates aKeyfrom a givenParametersobject.Finds the previously added creator (with
add(com.google.crypto.tink.internal.KeyCreator<ParametersT>, java.lang.Class<ParametersT>)) for the class given byparameters.getClass()and uses it.- Throws:
java.security.GeneralSecurityException
-
-