Package com.google.crypto.tink.subtle
Class EngineFactory<T_WRAPPER extends EngineWrapper<JcePrimitiveT>,JcePrimitiveT>
- java.lang.Object
-
- com.google.crypto.tink.subtle.EngineFactory<T_WRAPPER,JcePrimitiveT>
-
public final class EngineFactory<T_WRAPPER extends EngineWrapper<JcePrimitiveT>,JcePrimitiveT> extends java.lang.ObjectA factory that returns JCE engines, using pre-specified j.security.Providers.This class contains a lot of static factories and static functions returning factories: these allow customization and hide the typing complexity in this class. To use this class, import it, and replace your
Cipher.getInstance(...)withEngineFactory.CIPHER.getInstance(...).- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static EngineFactory<EngineWrapper.TCipher,javax.crypto.Cipher>CIPHERstatic EngineFactory<EngineWrapper.TKeyAgreement,javax.crypto.KeyAgreement>KEY_AGREEMENTstatic EngineFactory<EngineWrapper.TKeyFactory,java.security.KeyFactory>KEY_FACTORYstatic EngineFactory<EngineWrapper.TKeyPairGenerator,java.security.KeyPairGenerator>KEY_PAIR_GENERATORstatic EngineFactory<EngineWrapper.TMac,javax.crypto.Mac>MACstatic EngineFactory<EngineWrapper.TMessageDigest,java.security.MessageDigest>MESSAGE_DIGESTstatic EngineFactory<EngineWrapper.TSignature,java.security.Signature>SIGNATURE
-
Constructor Summary
Constructors Constructor Description EngineFactory(T_WRAPPER instanceBuilder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JcePrimitiveTgetInstance(java.lang.String algorithm)static java.util.List<java.security.Provider>toProviderList(java.lang.String... providerNames)Helper function to get a list of Providers from names.
-
-
-
Field Detail
-
CIPHER
public static final EngineFactory<EngineWrapper.TCipher,javax.crypto.Cipher> CIPHER
-
MAC
public static final EngineFactory<EngineWrapper.TMac,javax.crypto.Mac> MAC
-
SIGNATURE
public static final EngineFactory<EngineWrapper.TSignature,java.security.Signature> SIGNATURE
-
MESSAGE_DIGEST
public static final EngineFactory<EngineWrapper.TMessageDigest,java.security.MessageDigest> MESSAGE_DIGEST
-
KEY_AGREEMENT
public static final EngineFactory<EngineWrapper.TKeyAgreement,javax.crypto.KeyAgreement> KEY_AGREEMENT
-
KEY_PAIR_GENERATOR
public static final EngineFactory<EngineWrapper.TKeyPairGenerator,java.security.KeyPairGenerator> KEY_PAIR_GENERATOR
-
KEY_FACTORY
public static final EngineFactory<EngineWrapper.TKeyFactory,java.security.KeyFactory> KEY_FACTORY
-
-
Constructor Detail
-
EngineFactory
public EngineFactory(T_WRAPPER instanceBuilder)
-
-
Method Detail
-
toProviderList
public static java.util.List<java.security.Provider> toProviderList(java.lang.String... providerNames)
Helper function to get a list of Providers from names.
-
getInstance
public JcePrimitiveT getInstance(java.lang.String algorithm) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
-