KeysetHandle { public static final KeysetHandle read(KeysetReader reader, Aead masterKey) throws GeneralSecurityException, IOException { EncryptedKeyset encryptedKeyset = reader.readEncrypted(); assertEnoughEncryptedKeyMaterial(encryptedKeyset); return new KeysetHandle(decrypt(encryptedKeyset, masterKey)); } private  KeysetHandle(Keyset keyset); KeysetInfo getKeysetInfo(); @Deprecated static final KeysetHandle generateNew(com.google.crypto.tink.proto.KeyTemplate keyTemplate); static final KeysetHandle generateNew(KeyTemplate keyTemplate); static final KeysetHandle read(KeysetReader reader, Aead masterKey); static final KeysetHandle readNoSecret(KeysetReader reader); static final KeysetHandle readNoSecret(final byte[] serialized); void write(KeysetWriter keysetWriter, Aead masterKey); void writeNoSecret(KeysetWriter writer); KeysetHandle getPublicKeysetHandle(); @Override String toString(); static void assertEnoughKeyMaterial(Keyset keyset); static void assertEnoughEncryptedKeyMaterial(EncryptedKeyset keyset); P getPrimitive(Class<P> targetClassObject); P getPrimitive(KeyManager<P> customKeyManager, Class<P> targetClassObject);  }
@Test public void testVoidInputs() throws Exception { KeysetHandle unused; try { KeysetReader reader = BinaryKeysetReader.withBytes(new byte[0]); unused = KeysetHandle.read(reader, null ); fail("Expected GeneralSecurityException"); } catch (GeneralSecurityException e) { assertExceptionContains(e, "empty keyset"); } }