public final class HybridEncryptFactory extends Object
HybridEncrypt instances.
KeysetHandle keysetHandle = ...;
HybridEncrypt hybridEncrypt = HybridEncryptFactory.getPrimitive(keysetHandle);
byte[] plaintext = ...;
byte[] contextInfo = ...;
byte[] ciphertext = hybridEncrypt.encrypt(plaintext, contextInfo);
The returned primitive works with a keyset (rather than a single key). To encrypt a plaintext, it uses the primary key in the keyset, and prepends to the ciphertext a certain prefix associated with the primary key.
| Constructor and Description |
|---|
HybridEncryptFactory() |
| Modifier and Type | Method and Description |
|---|---|
static HybridEncrypt |
getPrimitive(KeysetHandle keysetHandle) |
static HybridEncrypt |
getPrimitive(KeysetHandle keysetHandle,
KeyManager<HybridEncrypt> keyManager) |
public static HybridEncrypt getPrimitive(KeysetHandle keysetHandle) throws GeneralSecurityException
keysetHandle.GeneralSecurityExceptionpublic static HybridEncrypt getPrimitive(KeysetHandle keysetHandle, KeyManager<HybridEncrypt> keyManager) throws GeneralSecurityException
keysetHandle and a custom keyManager.GeneralSecurityException