class KeyManagerImpl implements KeyManager<PrimitiveT> {

  @Override
  public final KeyData newKeyData(ByteString serializedKeyFormat) throws GeneralSecurityException {
    try {
      KeyProtoT key = keyFactoryHelper().parseValidateCreate(serializedKeyFormat);
      return KeyData.newBuilder()
          .setTypeUrl(getKeyType())
          .setValue(key.toByteString())
          .setKeyMaterialType(keyTypeManager.keyMaterialType())
          .build();
    } catch (InvalidProtocolBufferException e) {
      throw new GeneralSecurityException("Unexpected proto", e);
    }
  }

  public  KeyManagerImpl(
      KeyTypeManager<KeyProtoT> keyTypeManager, Class<PrimitiveT> primitiveClass);

}