public final class HybridDecryptFactory extends Object
HybridDecrypt instances.
KeysetHandle keysetHandle = ...;
HybridDecrypt hybridDecrypt = HybridDecryptFactory.getPrimitive(keysetHandle);
byte[] ciphertext = ...;
byte[] contextInfo = ...;
byte[] plaintext = hybridDecrypt.decrypt(ciphertext, contextInfo);
The returned primitive works with a keyset (rather than a single key). To decrypt, the
primitive uses the prefix of the ciphertext to efficiently select the right key in the set. If
the keys associated with the prefix do not work, the primitive tries all keys with OutputPrefixType.RAW.
| Constructor and Description |
|---|
HybridDecryptFactory() |
| Modifier and Type | Method and Description |
|---|---|
static HybridDecrypt |
getPrimitive(KeysetHandle keysetHandle) |
static HybridDecrypt |
getPrimitive(KeysetHandle keysetHandle,
KeyManager<HybridDecrypt> keyManager) |
public static HybridDecrypt getPrimitive(KeysetHandle keysetHandle) throws GeneralSecurityException
keysetHandle.GeneralSecurityExceptionpublic static HybridDecrypt getPrimitive(KeysetHandle keysetHandle, KeyManager<HybridDecrypt> keyManager) throws GeneralSecurityException
keysetHandle and a custom keyManager.GeneralSecurityException