Package com.google.crypto.tink.internal
Class MutableKeyDerivationRegistry
- java.lang.Object
-
- com.google.crypto.tink.internal.MutableKeyDerivationRegistry
-
public final class MutableKeyDerivationRegistry extends java.lang.ObjectStores methods to createKeyobjects fromParameterswith fixed randomness.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMutableKeyDerivationRegistry.InsecureKeyCreator<ParametersT extends Parameters>A class to create key objects from parameters with given randomness.
-
Constructor Summary
Constructors Constructor Description MutableKeyDerivationRegistry()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <ParametersT extends Parameters>
voidadd(MutableKeyDerivationRegistry.InsecureKeyCreator<ParametersT> creator, java.lang.Class<ParametersT> parametersClass)Adds a new "InsecureKeyCreator" to the instance.KeycreateKeyFromRandomness(Parameters parameters, java.io.InputStream inputStream, java.lang.Integer idRequirement, SecretKeyAccess access)Creates aKeyfrom a givenParametersobject and additional data.static MutableKeyDerivationRegistryglobalInstance()
-
-
-
Method Detail
-
globalInstance
public static MutableKeyDerivationRegistry globalInstance()
-
add
public <ParametersT extends Parameters> void add(MutableKeyDerivationRegistry.InsecureKeyCreator<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
-
createKeyFromRandomness
public Key createKeyFromRandomness(Parameters parameters, java.io.InputStream inputStream, @Nullable java.lang.Integer idRequirement, SecretKeyAccess access) throws java.security.GeneralSecurityException
Creates aKeyfrom a givenParametersobject and additional data.Finds the previously added creator (with
add(com.google.crypto.tink.internal.MutableKeyDerivationRegistry.InsecureKeyCreator<ParametersT>, java.lang.Class<ParametersT>)) for the class given byparameters.getClass()and uses it.- Throws:
java.security.GeneralSecurityException
-
-