class KeyManagerImpl implements KeyManager<PrimitiveT> {

  @Override
  public final PrimitiveT getPrimitive(ByteString serializedKey) throws GeneralSecurityException {
    try {
      KeyProtoT keyProto = keyTypeManager.parseKey(serializedKey);
      return validateKeyAndGetPrimitive(keyProto);
    } catch (InvalidProtocolBufferException e) {
      throw new GeneralSecurityException(
          "Failures parsing proto of type " + keyTypeManager.getKeyClass().getName(), e);
    }
  }

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

}