test_class.file: java_src/src/test/java/com/google/crypto/tink/CleartextKeysetHandleTest.java
test_class.identifier: CleartextKeysetHandleTest
test_case.body: @Test
    public void testRead() throws Exception {
      // Create a keyset that contains a single HmacKey.
      KeyTemplate template = MacKeyTemplates.HMAC_SHA256_128BITTAG;
      KeysetManager manager = KeysetManager.withEmptyKeyset().rotate(template);
      Keyset keyset1 = manager.getKeysetHandle().getKeyset();
  
      KeysetHandle handle1 =
          CleartextKeysetHandle.read(BinaryKeysetReader.withBytes(keyset1.toByteArray()));
      assertEquals(keyset1, handle1.getKeyset());
  
      KeysetHandle handle2 = KeysetHandle.generateNew(template);
      Keyset keyset2 = handle2.getKeyset();
      assertEquals(1, keyset2.getKeyCount());
      Keyset.Key key2 = keyset2.getKey(0);
      assertEquals(keyset2.getPrimaryKeyId(), key2.getKeyId());
      assertEquals(template.getTypeUrl(), key2.getKeyData().getTypeUrl());
      Mac unused = handle2.getPrimitive(Mac.class);
    }
test_case.class_method_signature: CleartextKeysetHandleTest.testRead()
test_case.full_signature: @Test public void testRead()
test_case.identifier: testRead
test_case.invocations: rotate withEmptyKeyset getKeyset getKeysetHandle read withBytes toByteArray assertEquals getKeyset generateNew getKeyset assertEquals getKeyCount getKey assertEquals getPrimaryKeyId getKeyId assertEquals getTypeUrl getTypeUrl getKeyData getPrimitive
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRead()
focal_class.file: java_src/src/main/java/com/google/crypto/tink/CleartextKeysetHandle.java
focal_class.identifier: CleartextKeysetHandle
focal_class.class_method_signature: CleartextKeysetHandle.parseFrom(final byte[] serialized)
focal_class.full_signature: @Deprecated public static final KeysetHandle parseFrom(final byte[] serialized)
focal_class.identifier: parseFrom
focal_class.modifiers: @Deprecated public static final
focal_class.parameters: (final byte[] serialized)
focal_class.return: KeysetHandle
focal_class.signature: KeysetHandle parseFrom(final byte[] serialized)
focal_class.class_method_signature: CleartextKeysetHandle.read(KeysetReader reader)
focal_class.full_signature: public static KeysetHandle read(KeysetReader reader)
focal_class.identifier: read
focal_class.modifiers: public static
focal_class.parameters: (KeysetReader reader)
focal_class.return: KeysetHandle
focal_class.signature: KeysetHandle read(KeysetReader reader)
focal_class.class_method_signature: CleartextKeysetHandle.getKeyset(KeysetHandle keysetHandle)
focal_class.full_signature: public static Keyset getKeyset(KeysetHandle keysetHandle)
focal_class.identifier: getKeyset
focal_class.modifiers: public static
focal_class.parameters: (KeysetHandle keysetHandle)
focal_class.return: Keyset
focal_class.signature: Keyset getKeyset(KeysetHandle keysetHandle)
focal_class.class_method_signature: CleartextKeysetHandle.fromKeyset(Keyset keyset)
focal_class.full_signature: public static KeysetHandle fromKeyset(Keyset keyset)
focal_class.identifier: fromKeyset
focal_class.modifiers: public static
focal_class.parameters: (Keyset keyset)
focal_class.return: KeysetHandle
focal_class.signature: KeysetHandle fromKeyset(Keyset keyset)
focal_class.class_method_signature: CleartextKeysetHandle.write(KeysetHandle handle, KeysetWriter keysetWriter)
focal_class.full_signature: public static void write(KeysetHandle handle, KeysetWriter keysetWriter)
focal_class.identifier: write
focal_class.modifiers: public static
focal_class.parameters: (KeysetHandle handle, KeysetWriter keysetWriter)
focal_class.return: void
focal_class.signature: void write(KeysetHandle handle, KeysetWriter keysetWriter)
focal_method.body: public static KeysetHandle read(KeysetReader reader)
        throws GeneralSecurityException, IOException {
      return KeysetHandle.fromKeyset(reader.read());
    }
focal_method.class_method_signature: CleartextKeysetHandle.read(KeysetReader reader)
focal_method.full_signature: public static KeysetHandle read(KeysetReader reader)
focal_method.identifier: read
focal_method.invocations: fromKeyset read
focal_method.modifiers: public static
focal_method.parameters: (KeysetReader reader)
focal_method.return: KeysetHandle
focal_method.signature: KeysetHandle read(KeysetReader reader)